]> git.proxmox.com Git - mirror_zfs-debian.git/commitdiff
Add Add-zvol_inhibit_dev-module-option.patch
authorDarik Horn <dajhorn@vanadac.com>
Sat, 2 Jun 2012 02:35:07 +0000 (21:35 -0500)
committerDarik Horn <dajhorn@vanadac.com>
Sat, 2 Jun 2012 02:35:07 +0000 (21:35 -0500)
ZoL can create more zvols at runtime than can be configured during
system start, which hangs the init stack at reboot.

When a slow system has more than a few hundred zvols, udev will
fork bomb during system start and spend too much time in device
detection routines, so upstart kills it.

The zfs_inhibit_dev option allows an affected system to be rescued
by skipping /dev/zd* creation and thereby avoiding the udev
overload. All zvols are made inaccessible if this option is set, but
the `zfs destroy` and `zfs send` commands still work, and ZFS
filesystems can be mounted.

debian/patches/0001-Prevent-manual-builds-in-the-DKMS-source.patch
debian/patches/0002-Remove-the-COPYING-file.patch
debian/patches/0003-Remove-all-upstream-init.d-components.patch
debian/patches/0004-Remove-the-upstream-dracut-component.patch
debian/patches/0005-Remove-userland-dist-rules.patch
debian/patches/0006-Improve-the-with-spl-error-for-DKMS-systems.patch
debian/patches/0007-Improve-the-SPL-version-error-for-DKMS-systems.patch
debian/patches/0008-Add-zvol_inhibit_dev-module-option.patch [new file with mode: 0644]
debian/patches/series

index a643ff9495c94a832d604e99213ce5127a0df475..22cda2103050f7c0818437cb4e63c24d9bc44e54 100644 (file)
@@ -1,7 +1,7 @@
 From 7aae00a440e25f340fc89d2ff2447e2eac9d2df4 Mon Sep 17 00:00:00 2001
 From: Darik Horn <dajhorn@vanadac.com>
 Date: Tue, 17 Jan 2012 19:45:07 -0600
-Subject: [PATCH 1/7] Prevent manual builds in the DKMS source.
+Subject: [PATCH 1/8] Prevent manual builds in the DKMS source.
 
 Print an instructive error messsage and exit if the `dkms.conf` file
 exists when the userland is configured. (ie: `--with-config=user`)
index 1d0cadfae1ecb46c7fb8ae05af298df1e2da71a1..789f8fdff5f26ae10a7d681e70fb51b4dc245a96 100644 (file)
@@ -1,7 +1,7 @@
 From f6e71b224d8780912d5922398042dde7744d8a70 Mon Sep 17 00:00:00 2001
 From: Darik Horn <dajhorn@vanadac.com>
 Date: Tue, 17 Jan 2012 22:18:47 -0600
-Subject: [PATCH 2/7] Remove the COPYING file.
+Subject: [PATCH 2/8] Remove the COPYING file.
 
 Resolve this lintian warning by removing the COPYING file:
 
index 58517f3493773afb7d2500a59ff1c998ca692253..38c751c86ffde13aaf45cdb5499a457e7206064e 100644 (file)
@@ -1,7 +1,7 @@
 From 93565d3b10f55fe5f7e7cf97fe99e5999e5d42ad Mon Sep 17 00:00:00 2001
 From: Darik Horn <dajhorn@vanadac.com>
 Date: Tue, 17 Jan 2012 11:54:21 -0600
-Subject: [PATCH 3/7] Remove all upstream init.d components.
+Subject: [PATCH 3/8] Remove all upstream init.d components.
 
 The etc/init.d/ components are redundant because the debian/ overlay
 bundles init files according to Debian packaging policy.
index 83a12165e4880110d764aa9cfc8d78e19bd0ef5a..47eabe67bbbd99f3a3d6efbae339cf3f3fb5ee20 100644 (file)
@@ -1,7 +1,7 @@
 From ee0715de8cb622329c6ee97f2dd64643cf7c2d49 Mon Sep 17 00:00:00 2001
 From: Darik Horn <dajhorn@vanadac.com>
 Date: Tue, 17 Jan 2012 20:27:32 -0600
-Subject: [PATCH 4/7] Remove the upstream dracut component.
+Subject: [PATCH 4/8] Remove the upstream dracut component.
 
 The dracut/ component broke deb systems when it first added to the
 upstream ZoL repository, had a near-zero download count when it was
index 7fc00c5e9b6a1e9ef54d3123fe4e495004cc799a..62c1c04e6f765b7448f12718c563d925abaf05b5 100644 (file)
@@ -1,7 +1,7 @@
 From c92b7f41578e91b84d6afbb52db3d0ecde47f040 Mon Sep 17 00:00:00 2001
 From: Darik Horn <dajhorn@vanadac.com>
 Date: Tue, 17 Jan 2012 22:23:16 -0600
-Subject: [PATCH 5/7] Remove userland dist rules.
+Subject: [PATCH 5/8] Remove userland dist rules.
 
 The `make dist` rule is used to create the DKMS source package, which
 does not contain the userland. (eg: Dist --with-config=kernel only.)
index 80eab7a8a0d4ebe303a80fa410c2890739cc53e0..164a4771b064c54d201c0b9c78ea78fdb704b435 100644 (file)
@@ -1,7 +1,7 @@
 From 215dffdd131de7a69ddd525c7331f50cb0038728 Mon Sep 17 00:00:00 2001
 From: Darik Horn <dajhorn@vanadac.com>
 Date: Fri, 3 Feb 2012 14:49:49 -0600
-Subject: [PATCH 6/7] Improve the --with-spl error for DKMS systems.
+Subject: [PATCH 6/8] Improve the --with-spl error for DKMS systems.
 
 If the SPL module is unavailable, then the operator gets an error
 message that does not apply to installations that are mananged by
index 40e81d2fa66ab6932a8a26958234236178d8f132..ffa757f6a4c2907d95721694f577268677eadf1c 100644 (file)
@@ -1,7 +1,7 @@
 From 64ecce70d27027e1903ab91cf47f98bb46d37356 Mon Sep 17 00:00:00 2001
 From: Darik Horn <dajhorn@vanadac.com>
 Date: Fri, 13 Apr 2012 09:22:29 -0500
-Subject: [PATCH 7/7] Improve the SPL version error for DKMS systems.
+Subject: [PATCH 7/8] Improve the SPL version error for DKMS systems.
 
 During kernel package upgrades, if DKMS tries to build the ZFS
 modules before the SPL module, then the operator gets an error
diff --git a/debian/patches/0008-Add-zvol_inhibit_dev-module-option.patch b/debian/patches/0008-Add-zvol_inhibit_dev-module-option.patch
new file mode 100644 (file)
index 0000000..2142305
--- /dev/null
@@ -0,0 +1,66 @@
+From f016c38557e02d98bf08b0fc392db00fd4f65107 Mon Sep 17 00:00:00 2001
+From: Darik Horn <dajhorn@vanadac.com>
+Date: Fri, 1 Jun 2012 20:49:10 -0500
+Subject: [PATCH 8/8] Add zvol_inhibit_dev module option.
+
+ZoL can create more zvols at runtime than can be configured during
+system start, which hangs the init stack at reboot.
+
+When a slow system has more than a few hundred zvols, udev will
+fork bomb during system start and spend too much time in device
+detection routines, so upstart kills it.
+
+The zfs_inhibit_dev option allows an affected system to be rescued
+by skipping /dev/zd* creation and thereby avoiding the udev
+overload. All zvols are made inaccessible if this option is set, but
+the `zfs destroy` and `zfs send` commands still work, and ZFS
+filesystems can be mounted.
+---
+ module/zfs/zvol.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
+index 9b13134..5ec8374 100644
+--- a/module/zfs/zvol.c
++++ b/module/zfs/zvol.c
+@@ -46,6 +46,7 @@
+ #include <sys/zvol.h>
+ #include <linux/blkdev_compat.h>
++unsigned int zvol_inhibit_dev = 0;
+ unsigned int zvol_major = ZVOL_MAJOR;
+ unsigned int zvol_threads = 32;
+@@ -1337,6 +1338,9 @@ zvol_create_minors(const char *pool)
+       spa_t *spa = NULL;
+       int error = 0;
++      if (zvol_inhibit_dev)
++              return;
++
+       mutex_enter(&zvol_state_lock);
+       if (pool) {
+               error = dmu_objset_find_spa(NULL, pool, zvol_create_minors_cb,
+@@ -1366,6 +1370,9 @@ zvol_remove_minors(const char *pool)
+       zvol_state_t *zv, *zv_next;
+       char *str;
++      if (zvol_inhibit_dev)
++              return;
++
+       str = kmem_zalloc(MAXNAMELEN, KM_SLEEP);
+       if (pool) {
+               (void) strncpy(str, pool, strlen(pool));
+@@ -1427,6 +1434,9 @@ zvol_fini(void)
+       list_destroy(&zvol_state_list);
+ }
++module_param(zvol_inhibit_dev, uint, 0444);
++MODULE_PARM_DESC(zvol_inhibit_dev, "Do not create zvol device nodes");
++
+ module_param(zvol_major, uint, 0444);
+ MODULE_PARM_DESC(zvol_major, "Major number for zvol device");
+-- 
+1.7.9.5
+
index 9427267b50e5f4fb12a76905648c3e31c8ec6e92..65fc1e624fd682be8b1d11fe5aca33a32aecc293 100644 (file)
@@ -5,4 +5,5 @@
 0005-Remove-userland-dist-rules.patch
 0006-Improve-the-with-spl-error-for-DKMS-systems.patch
 0007-Improve-the-SPL-version-error-for-DKMS-systems.patch
+0008-Add-zvol_inhibit_dev-module-option.patch
 volatile-version.patch