From d81440c8ab0661710756f8f62769f2609a586c03 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 14 Jul 2010 12:37:31 -0700 Subject: [PATCH 1/3] Check sourcelink is set before passing to readlink When no source was found in any of the expected paths treat this as fatal and provide the user with a hint as to what they should do. --- config/kernel.m4 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/config/kernel.m4 b/config/kernel.m4 index 4cea344ccd..9bf63d4272 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -84,13 +84,14 @@ AC_DEFUN([ZFS_AC_KERNEL], [ 2>/dev/null | grep -v obj | tail -1) fi - if test -e $sourcelink; then + if test -n "$sourcelink" && test -e ${sourcelink}; then kernelsrc=`readlink -f ${sourcelink}` else AC_MSG_RESULT([Not found]) AC_MSG_ERROR([ - *** Please specify the location of the kernel source - *** with the '--with-linux=PATH' option]) + *** Please make sure the kernel devel package for your distribution + *** is installed then try again. If that fails you can specify the + *** location of the kernel source with the '--with-linux=PATH' option.]) fi else if test "$kernelsrc" = "NONE"; then @@ -206,8 +207,9 @@ AC_DEFUN([ZFS_AC_SPL], [ else AC_MSG_RESULT([Not found]) AC_MSG_ERROR([ - *** Please specify the location of the spl source - *** with the '--with-spl=PATH' option]) + *** Please make sure the 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.]) fi else if test "$splsrc" = "NONE"; then From 548c9c6829bd01b4db50c739ba5b8d8b4081f033 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 14 Jul 2010 12:40:36 -0700 Subject: [PATCH 2/3] Use $target_cpu instead of `arch` We should not be using arch for a few reasons. First off it might not be installed on their system, and secondly they may be trying to cross-compile. --- config/kernel.m4 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/kernel.m4 b/config/kernel.m4 index 9bf63d4272..ca61dfd174 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -102,12 +102,12 @@ AC_DEFUN([ZFS_AC_KERNEL], [ AC_MSG_RESULT([$kernelsrc]) AC_MSG_CHECKING([kernel build directory]) if test -z "$kernelbuild"; then - if test -d ${kernelsrc}-obj/`arch`/`arch`; then - kernelbuild=${kernelsrc}-obj/`arch`/`arch` - elif test -d ${kernelsrc}-obj/`arch`/default; then - kernelbuild=${kernelsrc}-obj/`arch`/default - elif test -d `dirname ${kernelsrc}`/build-`arch`; then - kernelbuild=`dirname ${kernelsrc}`/build-`arch` + if test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then + kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu} + elif test -d ${kernelsrc}-obj/${target_cpu}/default; then + kernelbuild=${kernelsrc}-obj/${target_cpu}/default + elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then + kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu} else kernelbuild=${kernelsrc} fi From fc3e47c6d4d09a0829bb1920a1a0579ba15f3630 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 14 Jul 2010 12:35:24 -0700 Subject: [PATCH 3/3] Corrently handle return code in blk_end_request_x This was caught under Debian Lenny builds because they are one of the few/only current distros based on a 2.6.26 kernel. In one of the build conditionals I accidently failed to assign the return code to rc before returning. --- module/zfs/include/sys/blkdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/include/sys/blkdev.h b/module/zfs/include/sys/blkdev.h index 53ac24656d..b84f66aed4 100644 --- a/module/zfs/include/sys/blkdev.h +++ b/module/zfs/include/sys/blkdev.h @@ -125,7 +125,7 @@ blk_end_request_x(struct request *req, int error, unsigned int nr_bytes) bool rc; spin_lock_irq(q->queue_lock); - __blk_end_request_x(req, error, nr_bytes); + rc = __blk_end_request_x(req, error, nr_bytes); spin_unlock_irq(q->queue_lock); return rc;