From 188f526d43fabb89151f55955c93a910e9c26042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 25 Oct 2016 13:49:17 +0200 Subject: [PATCH] zfs: fix zpool import bug with nested pools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this was broken since Ubuntu-4.4.0-6.21, which contained 193fb6a2c94fab8eb8ce70a5da4d21c7d4023bee UBUNTU: SAUCE: block_dev: Support checking inode permissions in lookup_bdev() without this fix, ZFS does not detect vdevs on zvols correctly, which causes a soft hang when importing zpools consisting of such vdevs. note the comment in zfs/module/zfs/vdev.c , 1141-1143: in order to handle pools on top of zvols, do the opens in a single thread so that the same thread holds the spa_namespace_lock BugLink: http://bugs.launchpad.net/bugs/1636517 Signed-off-by: Fabian Grünbichler --- zfs/config/kernel-lookup-bdev.m4 | 2 +- zfs/module/zfs/zvol.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zfs/config/kernel-lookup-bdev.m4 b/zfs/config/kernel-lookup-bdev.m4 index 245f95f..123e238 100644 --- a/zfs/config/kernel-lookup-bdev.m4 +++ b/zfs/config/kernel-lookup-bdev.m4 @@ -7,7 +7,7 @@ AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_BDEV], ZFS_LINUX_TRY_COMPILE_SYMBOL([ #include ], [ - lookup_bdev(NULL); + lookup_bdev(NULL, 0); ], [lookup_bdev], [fs/block_dev.c], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_LOOKUP_BDEV, 1, [lookup_bdev() is available]) diff --git a/zfs/module/zfs/zvol.c b/zfs/module/zfs/zvol.c index 04f68b5..2fd8bb0 100644 --- a/zfs/module/zfs/zvol.c +++ b/zfs/module/zfs/zvol.c @@ -174,7 +174,7 @@ zvol_is_zvol(const char *device) struct block_device *bdev; unsigned int major; - bdev = lookup_bdev(device); + bdev = lookup_bdev(device, 0); if (IS_ERR(bdev)) return (B_FALSE); -- 2.1.4