From 093911f1945b5c164a45bb077103283dafdcae0c Mon Sep 17 00:00:00 2001 From: Chunwei Chen Date: Fri, 22 Jan 2016 12:23:55 -0800 Subject: [PATCH 1/2] Remove wrong ASSERT in annotate_ecksum When using large blocks like 1M, there will be more than UINT16_MAX qwords in one block, so this ASSERT would go off. Also, it is possible for the histogram to overflow. We cap them to UINT16_MAX to prevent this. Signed-off-by: Chunwei Chen Signed-off-by: Brian Behlendorf Closes #4257 --- module/zfs/zfs_fm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/zfs/zfs_fm.c b/module/zfs/zfs_fm.c index 7e9c473d3ea4..c7b7180009c8 100644 --- a/module/zfs/zfs_fm.c +++ b/module/zfs/zfs_fm.c @@ -457,7 +457,8 @@ update_histogram(uint64_t value_arg, uint16_t *hist, uint32_t *count) /* We store the bits in big-endian (largest-first) order */ for (i = 0; i < 64; i++) { if (value & (1ull << i)) { - hist[63 - i]++; + if (hist[63 - i] < UINT16_MAX) + hist[63 - i]++; ++bits; } } @@ -615,7 +616,6 @@ annotate_ecksum(nvlist_t *ereport, zio_bad_cksum_t *info, if (badbuf == NULL || goodbuf == NULL) return (eip); - ASSERT3U(nui64s, <=, UINT16_MAX); ASSERT3U(size, ==, nui64s * sizeof (uint64_t)); ASSERT3U(size, <=, SPA_MAXBLOCKSIZE); ASSERT3U(size, <=, UINT32_MAX); From c7e7ec1997d65ea173d943289feb4d07d414c905 Mon Sep 17 00:00:00 2001 From: Olaf Faaland Date: Wed, 20 Jan 2016 14:01:28 -0800 Subject: [PATCH 2/2] Make configure error clearer when failing to find SPL Signed-off-by: Olaf Faaland Signed-off-by: Brian Behlendorf Signed-off-by: Richard Yao Closes #4251 --- config/kernel.m4 | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/config/kernel.m4 b/config/kernel.m4 index f63a056e4d0f..9a52baed7335 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -252,7 +252,9 @@ AC_DEFUN([ZFS_AC_SPL], [ AC_ARG_WITH([spl], AS_HELP_STRING([--with-spl=PATH], [Path to spl source]), - [splsrc="$withval"]) + AS_IF([test "$withval" = "yes"], + AC_MSG_ERROR([--with-spl=PATH requires a PATH]), + [splsrc="$withval"])) AC_ARG_WITH([spl-obj], AS_HELP_STRING([--with-spl-obj=PATH], @@ -278,6 +280,14 @@ AC_DEFUN([ZFS_AC_SPL], [ AC_MSG_CHECKING([spl source directory]) AS_IF([test -z "${splsrc}"], [ + [all_spl_sources=" + ${splsrc0} + ${splsrc1} + ${splsrc2} + ${splsrc3} + ${splsrc4} + ${splsrc5} + ${splsrc6}"], AS_IF([ test -e "${splsrc0}/spl.release.in"], [ splsrc=${splsrc0} ], [ test -e "${splsrc1}/spl.release.in"], [ @@ -296,6 +306,7 @@ AC_DEFUN([ZFS_AC_SPL], [ splsrc="[Not found]" ]) ], [ + [all_spl_sources="$withval"], AS_IF([test "$splsrc" = "NONE"], [ splbuild=NONE splsrcver=NONE @@ -307,7 +318,10 @@ AC_DEFUN([ZFS_AC_SPL], [ AC_MSG_ERROR([ *** Please make sure the kmod spl devel package for your distribution *** is installed then try again. If that fails you can specify the - *** location of the spl source with the '--with-spl=PATH' option.]) + *** location of the spl source with the '--with-spl=PATH' option. + *** The spl version must match the version of ZFS you are building, + *** ${VERSION}. Failed to find spl.release.in in the following: + $all_spl_sources]) ]) dnl # @@ -323,6 +337,10 @@ AC_DEFUN([ZFS_AC_SPL], [ dnl # SPL package. dnl # AC_MSG_CHECKING([spl build directory]) + + all_spl_config_locs="${splsrc}/${LINUX_VERSION} + ${splsrc}" + while true; do AS_IF([test -z "$splbuild"], [ AS_IF([ test -e "${splsrc}/${LINUX_VERSION}/spl_config.h" ], [ @@ -349,7 +367,9 @@ AC_DEFUN([ZFS_AC_SPL], [ *** Please make sure the kmod spl devel package for your *** distribution is installed then try again. If that fails you *** can specify the location of the spl objects with the - *** '--with-spl-obj=PATH' option.]) + *** '--with-spl-obj=PATH' option. Failed to find spl_config.h in + *** any of the following: + $all_spl_config_locs]) ]) AC_MSG_CHECKING([spl source version])