diff options
author | Richard Yao <ryao@gentoo.org> | 2013-07-14 11:49:53 +0000 |
---|---|---|
committer | Richard Yao <ryao@gentoo.org> | 2013-07-14 11:49:53 +0000 |
commit | 11cb32c26d0cabca5e4f2a0f886863e6b87a32dd (patch) | |
tree | 596a286f3290ea84e95cc099b4a99439e51d2427 | |
parent | Linux 3.10 compatibility; Fix kernel builtin support (diff) | |
download | gentoo-2-11cb32c26d0cabca5e4f2a0f886863e6b87a32dd.tar.gz gentoo-2-11cb32c26d0cabca5e4f2a0f886863e6b87a32dd.tar.bz2 gentoo-2-11cb32c26d0cabca5e4f2a0f886863e6b87a32dd.zip |
Linux 3.10 support; asynchronous zvol initialization; miscellaneous fixes for panics, deadlocks and NULL pointer dereferences
(Portage version: 2.2.0_alpha187/cvs/Linux x86_64, signed Manifest commit with key 0xBEE84C64)
-rw-r--r-- | sys-fs/zfs-kmod/ChangeLog | 15 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-arc-read-panic.patch | 42 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch | 58 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch | 73 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization-r1.patch (renamed from sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization.patch) | 92 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-linux-3.10-compat.patch | 108 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/zfs-kmod-0.6.1-r2.ebuild (renamed from sys-fs/zfs-kmod/zfs-kmod-0.6.1-r1.ebuild) | 18 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/zfs-kmod-0.6.1.ebuild | 123 |
8 files changed, 383 insertions, 146 deletions
diff --git a/sys-fs/zfs-kmod/ChangeLog b/sys-fs/zfs-kmod/ChangeLog index f236b67521a2..6821de1b5703 100644 --- a/sys-fs/zfs-kmod/ChangeLog +++ b/sys-fs/zfs-kmod/ChangeLog @@ -1,6 +1,19 @@ # ChangeLog for sys-fs/zfs-kmod # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs-kmod/ChangeLog,v 1.32 2013/05/29 02:00:47 ryao Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs-kmod/ChangeLog,v 1.33 2013/07/14 11:49:53 ryao Exp $ + +*zfs-kmod-0.6.1-r2 (14 Jul 2013) + + 14 Jul 2013; Richard Yao <ryao@gentoo.org> + +files/zfs-kmod-0.6.1-fix-arc-read-panic.patch, + +files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch, + +files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch, + +files/zfs-kmod-0.6.1-fix-zvol-initialization-r1.patch, + +files/zfs-kmod-0.6.1-linux-3.10-compat.patch, +zfs-kmod-0.6.1-r2.ebuild, + -files/zfs-kmod-0.6.1-fix-zvol-initialization.patch, + -zfs-kmod-0.6.1-r1.ebuild, -zfs-kmod-0.6.1.ebuild: + Linux 3.10 support; asynchronous zvol initialization; miscellaneous fixes for + panics, deadlocks and NULL pointer dereferences 29 May 2013; Richard Yao <ryao@gentoo.org> zfs-kmod-0.6.1-r1.ebuild: Add blocker against CONFIG_UIDGID_STRICT_TYPE_CHECKS diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-arc-read-panic.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-arc-read-panic.patch new file mode 100644 index 000000000000..00ec1057efa1 --- /dev/null +++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-arc-read-panic.patch @@ -0,0 +1,42 @@ +From 3db3ff4a787acf068b122562fb5be5aecec2611f Mon Sep 17 00:00:00 2001 +From: Richard Yao <ryao@gentoo.org> +Date: Tue, 2 Jul 2013 00:07:15 -0400 +Subject: [PATCH] Use MAXPATHLEN instead of sizeof in snprintf +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This silences a GCC 4.8.0 warning by fixing a programming error +caught by static analysis: + +../../cmd/ztest/ztest.c: In function ‘ztest_vdev_aux_add_remove’: +../../cmd/ztest/ztest.c:2584:33: error: argument to ‘sizeof’ + in ‘snprintf’ call is the same expression as the destination; + did you mean to provide an explicit length? + [-Werror=sizeof-pointer-memaccess] + (void) snprintf(path, sizeof (path), ztest_aux_template, + ^ + +Signed-off-by: Richard Yao <ryao@gentoo.org> +Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> +Closes #1480 +--- + cmd/ztest/ztest.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c +index b38d7b1..93a5f1e 100644 +--- a/cmd/ztest/ztest.c ++++ b/cmd/ztest/ztest.c +@@ -2581,7 +2581,7 @@ enum ztest_object { + zs->zs_vdev_aux = 0; + for (;;) { + int c; +- (void) snprintf(path, sizeof (path), ztest_aux_template, ++ (void) snprintf(path, MAXPATHLEN, ztest_aux_template, + ztest_opts.zo_dir, ztest_opts.zo_pool, aux, + zs->zs_vdev_aux); + for (c = 0; c < sav->sav_count; c++) +-- +1.8.1.6 + diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch new file mode 100644 index 000000000000..e59c869eed04 --- /dev/null +++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch @@ -0,0 +1,58 @@ +From ab68b6e5db29abcd20c0c7b12a8c2fa570031c8b Mon Sep 17 00:00:00 2001 +From: Tim Chase <tim@chase2k.com> +Date: Mon, 24 Jun 2013 22:03:56 -0500 +Subject: [PATCH] Fix zfs_sb_teardown/zfs_resume_fs NULL dereference + +Fix a pair of conditions in which a concurrent umount can cause +NULL pointer dereferences: + +* zfs_sb_teardown - prevent a NULL dereference by not calling + dmu_objset_pool with a null z_os. + +* zfs_resume_fs - don't try to unmount with a null z_os. This + change makes the ZoL code more consistent + with both Illumos and FreeBSD. + +Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> +Closes #1543 +--- + module/zfs/zfs_vfsops.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c +index e618f2b..602c332 100644 +--- a/module/zfs/zfs_vfsops.c ++++ b/module/zfs/zfs_vfsops.c +@@ -1056,10 +1056,12 @@ + } + + /* +- * Drain the iput_taskq to ensure all active references to the ++ * If someone has not already unmounted this file system, ++ * drain the iput_taskq to ensure all active references to the + * zfs_sb_t have been handled only then can it be safely destroyed. + */ +- taskq_wait(dsl_pool_iput_taskq(dmu_objset_pool(zsb->z_os))); ++ if (zsb->z_os) ++ taskq_wait(dsl_pool_iput_taskq(dmu_objset_pool(zsb->z_os))); + + /* + * Close the zil. NB: Can't close the zil while zfs_inactive +@@ -1480,10 +1482,11 @@ + + if (err) { + /* +- * Since we couldn't reopen zfs_sb_t, force +- * unmount this file system. ++ * Since we couldn't reopen zfs_sb_t or, setup the ++ * sa framework, force unmount this file system. + */ +- (void) zfs_umount(zsb->z_sb); ++ if (zsb->z_os) ++ (void) zfs_umount(zsb->z_sb); + } + return (err); + } +-- +1.8.1.6 + diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch new file mode 100644 index 000000000000..7cca7d1137c8 --- /dev/null +++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch @@ -0,0 +1,73 @@ +From 76351672c222f28ea1b681097a9eff58a6791555 Mon Sep 17 00:00:00 2001 +From: Brian Behlendorf <behlendorf1@llnl.gov> +Date: Thu, 11 Jul 2013 14:11:32 -0700 +Subject: [PATCH] Fix zfsctl_expire_snapshot() deadlock + +It is possible for an automounted snapshot which is expiring to +deadlock with a manual unmount of the snapshot. This can occur +because taskq_cancel_id() will block if the task is currently +executing until it completes. But it will never complete because +zfsctl_unmount_snapshot() is holding the zsb->z_ctldir_lock which +zfsctl_expire_snapshot() must acquire. + +---------------------- z_unmount/0:2153 --------------------- + mutex_lock <blocking on zsb->z_ctldir_lock> + zfsctl_unmount_snapshot + zfsctl_expire_snapshot + taskq_thread + +------------------------- zfs:10690 ------------------------- + taskq_wait_id <waiting for z_unmount to exit> + taskq_cancel_id + __zfsctl_unmount_snapshot + zfsctl_unmount_snapshot <takes zsb->z_ctldir_lock> + zfs_unmount_snap + zfs_ioc_destroy_snaps_nvl + zfsdev_ioctl + do_vfs_ioctl + +We resolve the deadlock by dropping the zsb->z_ctldir_lock before +calling __zfsctl_unmount_snapshot(). The lock is only there to +prevent concurrent modification to the zsb->z_ctldir_snaps AVL +tree. Moreover, we're careful to remove the zfs_snapentry_t from +the AVL tree before dropping the lock which ensures no other tasks +can find it. On failure it's added back to the tree. + +Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> +Signed-off-by: Chris Dunlap <cdunlap@llnl.gov> +Closes #1527 +--- + module/zfs/zfs_ctldir.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c +index 4fa530b..168f853 100644 +--- a/module/zfs/zfs_ctldir.c ++++ b/module/zfs/zfs_ctldir.c +@@ -732,7 +732,11 @@ struct inode * + sep = avl_find(&zsb->z_ctldir_snaps, &search, NULL); + if (sep) { + avl_remove(&zsb->z_ctldir_snaps, sep); ++ mutex_exit(&zsb->z_ctldir_lock); ++ + error = __zfsctl_unmount_snapshot(sep, flags); ++ ++ mutex_enter(&zsb->z_ctldir_lock); + if (error == EBUSY) + avl_add(&zsb->z_ctldir_snaps, sep); + else +@@ -767,7 +771,11 @@ struct inode * + while (sep != NULL) { + next = AVL_NEXT(&zsb->z_ctldir_snaps, sep); + avl_remove(&zsb->z_ctldir_snaps, sep); ++ mutex_exit(&zsb->z_ctldir_lock); ++ + error = __zfsctl_unmount_snapshot(sep, flags); ++ ++ mutex_enter(&zsb->z_ctldir_lock); + if (error == EBUSY) { + avl_add(&zsb->z_ctldir_snaps, sep); + (*count)++; +-- +1.8.1.6 + diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization-r1.patch index 660d76c82ccf..b1e7d3736db0 100644 --- a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization.patch +++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization-r1.patch @@ -1,5 +1,5 @@ diff --git a/module/zfs/spa.c b/module/zfs/spa.c -index 82ee445..eaf05b9 100644 +index e986e92..65f78b7 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -64,6 +64,7 @@ @@ -39,28 +39,56 @@ index 82ee445..eaf05b9 100644 *spapp = spa; return (0); +@@ -4010,6 +4019,10 @@ spa_import(const char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags) + mutex_exit(&spa_namespace_lock); + spa_history_log_version(spa, LOG_POOL_IMPORT); + ++#ifdef _KERNEL ++ zvol_create_minors(pool); ++#endif ++ + return (0); + } + +diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c +index 1226b2c..a9184a1 100644 +--- a/module/zfs/zfs_ioctl.c ++++ b/module/zfs/zfs_ioctl.c +@@ -1268,9 +1268,6 @@ zfs_ioc_pool_import(zfs_cmd_t *zc) + error = err; + } + +- if (error == 0) +- zvol_create_minors(zc->zc_name); +- + nvlist_free(config); + + if (props) diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c -index b41eeb2..f9387a7 100644 +index 43a7bb6..e35c91b 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c -@@ -1217,6 +1217,8 @@ zvol_alloc(dev_t dev, const char *name) - if (zv == NULL) - goto out; +@@ -1215,6 +1215,9 @@ zvol_alloc(dev_t dev, const char *name) + + zv = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP); + spin_lock_init(&zv->zv_lock); ++ list_link_init(&zv->zv_next); + zv->zv_queue = blk_init_queue(zvol_request, &zv->zv_lock); if (zv->zv_queue == NULL) goto out_kmem; -@@ -1250,7 +1252,6 @@ zvol_alloc(dev_t dev, const char *name) +@@ -1248,9 +1251,6 @@ zvol_alloc(dev_t dev, const char *name) sizeof (rl_t), offsetof(rl_t, r_node)); zv->zv_znode.z_is_zvol = TRUE; - spin_lock_init(&zv->zv_lock); - list_link_init(&zv->zv_next); - +- list_link_init(&zv->zv_next); +- zv->zv_disk->major = zvol_major; -@@ -1563,36 +1564,40 @@ zvol_init(void) + zv->zv_disk->first_minor = (dev & MINORMASK); + zv->zv_disk->fops = &zvol_ops; +@@ -1561,30 +1561,36 @@ zvol_init(void) { int error; @@ -91,23 +119,49 @@ index b41eeb2..f9387a7 100644 - mutex_init(&zvol_state_lock, NULL, MUTEX_DEFAULT, NULL); - list_create(&zvol_state_list, sizeof (zvol_state_t), - offsetof(zvol_state_t, zv_next)); -- ++ return (0); + - (void) zvol_create_minors(NULL); -- - return (0); -+ +out2: + taskq_destroy(zvol_taskq); +out1: + mutex_destroy(&zvol_state_lock); + list_destroy(&zvol_state_list); + +- return (0); + return (error); } void - zvol_fini(void) - { -- zvol_remove_minors(NULL); - blk_unregister_region(MKDEV(zvol_major, 0), 1UL << MINORBITS); - unregister_blkdev(zvol_major, ZVOL_DRIVER); - taskq_destroy(zvol_taskq); +diff --git a/scripts/zconfig.sh b/scripts/zconfig.sh +index 141348c..281166c 100755 +--- a/scripts/zconfig.sh ++++ b/scripts/zconfig.sh +@@ -264,8 +264,9 @@ test_4() { + zconfig_zvol_device_stat 0 ${POOL_NAME} ${FULL_ZVOL_NAME} \ + ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 9 + +- # Load the modules, wait 1 second for udev ++ # Load the modules, list the pools to ensure they are opened + ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 10 ++ ${ZPOOL} list &>/dev/null + + # Verify the devices were created + zconfig_zvol_device_stat 10 ${POOL_NAME} ${FULL_ZVOL_NAME} \ +diff --git a/udev/rules.d/90-zfs.rules.in b/udev/rules.d/90-zfs.rules.in +index 52e1d63..a2715d2 100644 +--- a/udev/rules.d/90-zfs.rules.in ++++ b/udev/rules.d/90-zfs.rules.in +@@ -1,4 +1,4 @@ +-SUBSYSTEM!="block", GOTO="zfs_end" ++SUBSYSTEM!="block|misc", GOTO="zfs_end" + ACTION!="add|change", GOTO="zfs_end" + + ENV{ID_FS_TYPE}=="zfs", RUN+="/sbin/modprobe zfs" +@@ -7,4 +7,6 @@ ENV{ID_FS_TYPE}=="zfs_member", RUN+="/sbin/modprobe zfs" + KERNEL=="null", SYMLINK+="root" + SYMLINK=="null", SYMLINK+="root" + ++SUBSYSTEM=="misc", KERNEL=="zfs", RUN+="@sbindir@/zpool list" ++ + LABEL="zfs_end" diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-linux-3.10-compat.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-linux-3.10-compat.patch new file mode 100644 index 000000000000..90755a1a527f --- /dev/null +++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-linux-3.10-compat.patch @@ -0,0 +1,108 @@ +commit a1d9543a39942be56879ca9338078afc77c25cea +Author: Chris Dunlop <chris@onthe.net.au> +Date: Mon Jun 3 16:58:52 2013 +1000 + + 3.10 API change: block_device_operations->release() returns void + + Linux kernel commit torvalds/linux@db2a144 changed the return type + of block_device_operations->release() to void. Detect the expected + prototype and defined our callout accordingly. + + Signed-off-by: Chris Dunlop <chris@onthe.net.au> + Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> + Closes #1494 + +diff --git a/config/kernel-bdev-block-device-operations.m4 b/config/kernel-bdev-block-device-operations.m4 +index 8b5e0a3..faacc19 100644 +--- a/config/kernel-bdev-block-device-operations.m4 ++++ b/config/kernel-bdev-block-device-operations.m4 +@@ -10,7 +10,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS], [ + + int blk_open(struct block_device *bdev, fmode_t mode) + { return 0; } +- int blk_release(struct gendisk *g, fmode_t mode) { return 0; } + int blk_ioctl(struct block_device *bdev, fmode_t mode, + unsigned x, unsigned long y) { return 0; } + int blk_compat_ioctl(struct block_device * bdev, fmode_t mode, +@@ -19,7 +18,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS], [ + static const struct block_device_operations + bops __attribute__ ((unused)) = { + .open = blk_open, +- .release = blk_release, ++ .release = NULL, + .ioctl = blk_ioctl, + .compat_ioctl = blk_compat_ioctl, + }; +diff --git a/config/kernel-block-device-operations-release-void.m4 b/config/kernel-block-device-operations-release-void.m4 +new file mode 100644 +index 0000000..a73f858 +--- /dev/null ++++ b/config/kernel-block-device-operations-release-void.m4 +@@ -0,0 +1,29 @@ ++dnl # ++dnl # 3.10.x API change ++dnl # ++AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [ ++ AC_MSG_CHECKING([whether block_device_operations.release is void]) ++ tmp_flags="$EXTRA_KCFLAGS" ++ EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}" ++ ZFS_LINUX_TRY_COMPILE([ ++ #include <linux/blkdev.h> ++ ++ void blk_release(struct gendisk *g, fmode_t mode) { return; } ++ ++ static const struct block_device_operations ++ bops __attribute__ ((unused)) = { ++ .open = NULL, ++ .release = blk_release, ++ .ioctl = NULL, ++ .compat_ioctl = NULL, ++ }; ++ ],[ ++ ],[ ++ AC_MSG_RESULT(void) ++ AC_DEFINE(HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID, 1, ++ [struct block_device_operations.release returns void]) ++ ],[ ++ AC_MSG_RESULT(int) ++ ]) ++ EXTRA_KCFLAGS="$tmp_flags" ++]) +diff --git a/config/kernel.m4 b/config/kernel.m4 +index 7b8e3b0..46c0255 100644 +--- a/config/kernel.m4 ++++ b/config/kernel.m4 +@@ -7,6 +7,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ + ZFS_AC_TEST_MODULE + ZFS_AC_KERNEL_CONFIG + ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS ++ ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID + ZFS_AC_KERNEL_TYPE_FMODE_T + ZFS_AC_KERNEL_KOBJ_NAME_LEN + ZFS_AC_KERNEL_3ARG_BLKDEV_GET +diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c +index e35c91b..b516156 100644 +--- a/module/zfs/zvol.c ++++ b/module/zfs/zvol.c +@@ -1024,7 +1024,11 @@ out_mutex: + return (error); + } + ++#ifdef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID ++static void ++#else + static int ++#endif + zvol_release(struct gendisk *disk, fmode_t mode) + { + zvol_state_t *zv = disk->private_data; +@@ -1044,7 +1048,9 @@ zvol_release(struct gendisk *disk, fmode_t mode) + if (drop_mutex) + mutex_exit(&zvol_state_lock); + ++#ifndef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID + return (0); ++#endif + } + + static int diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.1-r1.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.1-r2.ebuild index 4d8f5a7bd06d..25ccb8f3adc5 100644 --- a/sys-fs/zfs-kmod/zfs-kmod-0.6.1-r1.ebuild +++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.1-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs-kmod/zfs-kmod-0.6.1-r1.ebuild,v 1.3 2013/05/29 02:00:47 ryao Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs-kmod/zfs-kmod-0.6.1-r2.ebuild,v 1.1 2013/07/14 11:49:53 ryao Exp $ EAPI="4" @@ -61,7 +61,7 @@ pkg_setup() { kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required" [ ${PV} != "9999" ] && \ - { kernel_is le 3 9 || die "Linux 3.9 is the latest supported version."; } + { kernel_is le 3 10 || die "Linux 3.10 is the latest supported version."; } check_extra_config } @@ -80,7 +80,19 @@ src_prepare() { epatch "${FILESDIR}/${P}-fix-xattr-behavior-2.patch" # Make certain that zvols always appear - epatch "${FILESDIR}/${P}-fix-zvol-initialization.patch" + epatch "${FILESDIR}/${P}-fix-zvol-initialization-r1.patch" + + # Linux 3.10 Compatibility + epatch "${FILESDIR}/${PN}-0.6.1-linux-3.10-compat.patch" + + # ARC Read Panic Fix + epatch "${FILESDIR}/${PN}-0.6.1-fix-arc-read-panic.patch" + + # Fix zfsctl_expire_snapshot deadlock + epatch "${FILESDIR}/${PN}-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch" + + # Fix NULL pointer dereference in zfsctl_expire_snapshot + epatch "${FILESDIR}/${PN}-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch" fi # Remove GPLv2-licensed ZPIOS unless we are debugging diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.1.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.1.ebuild deleted file mode 100644 index 299452a24dfb..000000000000 --- a/sys-fs/zfs-kmod/zfs-kmod-0.6.1.ebuild +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs-kmod/zfs-kmod-0.6.1.ebuild,v 1.2 2013/04/17 13:27:54 ryao Exp $ - -EAPI="4" - -AT_M4DIR="config" -AUTOTOOLS_AUTORECONF="1" -AUTOTOOLS_IN_SOURCE_BUILD="1" - -inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils - -if [ ${PV} == "9999" ] ; then - inherit git-2 - MY_PV=9999 - EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git" -else - inherit eutils versionator - MY_PV=$(replace_version_separator 3 '-') - SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz" - S="${WORKDIR}/zfs-zfs-${MY_PV}" - KEYWORDS="~amd64" -fi - -DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" -HOMEPAGE="http://zfsonlinux.org/" - -LICENSE="CDDL debug? ( GPL-2+ )" -SLOT="0" -IUSE="custom-cflags debug +rootfs" -RESTRICT="test" - -DEPEND=" - =sys-kernel/spl-${PV}* - dev-lang/perl - virtual/awk -" - -RDEPEND="${DEPEND} - !sys-fs/zfs-fuse -" - -pkg_setup() { - linux-info_pkg_setup - CONFIG_CHECK="!DEBUG_LOCK_ALLOC - BLK_DEV_LOOP - EFI_PARTITION - IOSCHED_NOOP - MODULES - !PAX_KERNEXEC_PLUGIN_METHOD_OR - ZLIB_DEFLATE - ZLIB_INFLATE - " - - use rootfs && \ - CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD - DEVTMPFS" - - kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required" - - [ ${PV} != "9999" ] && \ - { kernel_is le 3 9 || die "Linux 3.9 is the latest supported version."; } - - check_extra_config -} - -src_prepare() { - # Remove GPLv2-licensed ZPIOS unless we are debugging - use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in" - - autotools-utils_src_prepare -} - -src_configure() { - use custom-cflags || strip-flags - filter-ldflags -Wl,* - - set_arch_to_kernel - local myeconfargs=( - --bindir="${EPREFIX}/bin" - --sbindir="${EPREFIX}/sbin" - --with-config=kernel - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - $(use_enable debug) - ) - autotools-utils_src_configure -} - -src_install() { - autotools-utils_src_install - dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown - - # Provide /usr/src/zfs symlink for lustre - dosym "$(basename $(echo "${ED}/usr/src/zfs-"*))/${KV_FULL}" /usr/src/zfs -} - -pkg_postinst() { - linux-mod_pkg_postinst - - # Remove old modules - if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ] - then - ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs" - ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs" - ewarn "Automatically removing old modules to avoid problems." - rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules" - rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon" - fi - - if use x86 || use arm - then - ewarn "32-bit kernels will likely require increasing vmalloc to" - ewarn "at least 256M and decreasing zfs_arc_max to some value less than that." - fi - - ewarn "This version of ZFSOnLinux includes support for features flags." - ewarn "If you upgrade your pools to make use of feature flags, you will lose" - ewarn "the ability to import them using older versions of ZFSOnLinux." - ewarn "Any new pools will be created with feature flag support and will" - ewarn "not be compatible with older versions of ZFSOnLinux. To create a new" - ewarn "pool that is backward compatible, use zpool create -o version=28 ..." -} |