diff -Nru zfs-linux-0.6.5.6/debian/changelog zfs-linux-0.6.5.6/debian/changelog --- zfs-linux-0.6.5.6/debian/changelog 2016-10-04 13:07:52.000000000 +0000 +++ zfs-linux-0.6.5.6/debian/changelog 2016-10-25 15:58:11.000000000 +0000 @@ -1,3 +1,15 @@ +zfs-linux (0.6.5.6-0ubuntu15) xenial; urgency=medium + + * Fix zpool import with vdev on zvol hang (LP: #1636517) + Xenial kernel commit 193fb6a2c94fab8eb8ce70a5da4d21c7d4023bee + ("block_dev: Support checking inode permissions in lookup_bdev()") + added a flags argument to block_dev which caused this breakage. Add + detection of 1 or 2 arg block_dev and add a zfs_block_dev shim to + abstract these differences away. Kudos to Fabian Grünbichler for + the original fix that this fix is based on. + + -- Colin Ian King Tue, 25 Oct 2016 16:58:11 +0100 + zfs-linux (0.6.5.6-0ubuntu14) xenial; urgency=medium * Fix zfs services to fail on first boot due to zfs services starting up diff -Nru zfs-linux-0.6.5.6/debian/patches/1014-kernel-lookup-bdev.patch zfs-linux-0.6.5.6/debian/patches/1014-kernel-lookup-bdev.patch --- zfs-linux-0.6.5.6/debian/patches/1014-kernel-lookup-bdev.patch 1970-01-01 00:00:00.000000000 +0000 +++ zfs-linux-0.6.5.6/debian/patches/1014-kernel-lookup-bdev.patch 2016-10-25 15:31:23.000000000 +0000 @@ -0,0 +1,58 @@ +Index: zfs-linux-0.6.5.6/config/kernel-lookup-bdev.m4 +=================================================================== +--- zfs-linux-0.6.5.6.orig/config/kernel-lookup-bdev.m4 ++++ zfs-linux-0.6.5.6/config/kernel-lookup-bdev.m4 +@@ -13,5 +13,16 @@ AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_BDEV], + AC_DEFINE(HAVE_LOOKUP_BDEV, 1, [lookup_bdev() is available]) + ], [ + AC_MSG_RESULT(no) ++ AC_MSG_CHECKING([whether lookup_bdev() is available and wants 2 args]) ++ ZFS_LINUX_TRY_COMPILE_SYMBOL([ ++ #include ++ ], [ ++ lookup_bdev(NULL, 0); ++ ], [lookup_bdev], [fs/block_dev.c], [ ++ AC_MSG_RESULT(yes) ++ AC_DEFINE(HAVE_LOOKUP_BDEV_2ARGS, 1, [lookup_bdev() with 2 args is available]) ++ ], [ ++ AC_MSG_RESULT(no) ++ ]) + ]) + ]) +Index: zfs-linux-0.6.5.6/module/zfs/zvol.c +=================================================================== +--- zfs-linux-0.6.5.6.orig/module/zfs/zvol.c ++++ zfs-linux-0.6.5.6/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 = zfs_lookup_bdev(device); + if (IS_ERR(bdev)) + return (B_FALSE); + +Index: zfs-linux-0.6.5.6/include/linux/blkdev_compat.h +=================================================================== +--- zfs-linux-0.6.5.6.orig/include/linux/blkdev_compat.h ++++ zfs-linux-0.6.5.6/include/linux/blkdev_compat.h +@@ -236,9 +236,17 @@ bio_set_flags_failfast(struct block_devi + * 2.6.27 API change + * The function was exported for use, prior to this it existed by the + * symbol was not exported. ++ * ++ * Ubuntu Xenial commit 193fb6a2c94fab8eb8ce70a5da4d21c7d4023bee ++ * ("UBUNTU: SAUCE: block_dev: Support checking inode permissions in lookup_bdev()") ++ * added in a mask parameter which we set as zero. + */ +-#ifndef HAVE_LOOKUP_BDEV +-#define lookup_bdev(path) ERR_PTR(-ENOTSUP) ++#ifdef HAVE_LOOKUP_BDEV ++#define zfs_lookup_bdev(path) lookup_bdev(path) ++#elif defined(HAVE_LOOKUP_BDEV_2ARGS) ++#define zfs_lookup_bdev(path) lookup_bdev(path, 0) ++#else ++#define zfs_lookup_bdev(path) ERR_PTR(-ENOTSUP) + #endif + + /* diff -Nru zfs-linux-0.6.5.6/debian/patches/series zfs-linux-0.6.5.6/debian/patches/series --- zfs-linux-0.6.5.6/debian/patches/series 2016-10-04 13:07:50.000000000 +0000 +++ zfs-linux-0.6.5.6/debian/patches/series 2016-10-25 15:25:43.000000000 +0000 @@ -17,3 +17,4 @@ 1011-Fix-ztest-truncated-cache-file.patch 1012-cmd-python-exec-path.patch 1013-Fix-dev-zfs-device-is-missing.patch +1014-kernel-lookup-bdev.patch