]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Increase default udev wait time
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 11 Oct 2013 21:24:18 +0000 (14:24 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 22 Oct 2013 17:25:51 +0000 (10:25 -0700)
When creating a new pool, or adding/replacing a disk in an existing
pool, partition tables will be automatically created on the devices.
Under normal circumstances it will take less than a second for udev
to create the expected device files under /dev/.  However, it has
been observed that if the system is doing heavy IO concurrently udev
may take far longer.  If you also throw in some cheap dodgy hardware
it may take even longer.

To prevent zpool commands from failing due to this the default wait
time for udev is being increased to 30 seconds.  This will have no
impact on normal usage, the increase timeout should only be noticed
if your udev rules are incorrectly configured.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1646

cmd/zpool/zpool_vdev.c
include/libzfs.h
lib/libzfs/libzfs_dataset.c

index 5309323b2cd144969e888d6205170b92902e7e3f..60d05565c037f4e41732fb524a2588ae739a313b 100644 (file)
@@ -1207,7 +1207,7 @@ make_disks(zpool_handle_t *zhp, nvlist_t *nv)
                            strrchr(devpath, '/') + 1) == -1)
                                return (-1);
 
-                       ret = zpool_label_disk_wait(udevpath, 1000);
+                       ret = zpool_label_disk_wait(udevpath, DISK_LABEL_WAIT);
                        if (ret) {
                                (void) fprintf(stderr, gettext("cannot "
                                    "resolve path '%s': %d\n"), udevpath, ret);
index 3826c2cc83381904fc302a33bb5d8137f1f6e097..273286ceb8f5c1a77626c0c19e60dcfbe16e65c9 100644 (file)
@@ -57,6 +57,11 @@ extern "C" {
 #define        DISK_ROOT               "/dev"
 #define        UDISK_ROOT              "/dev/disk"
 
+/*
+ * Default wait time for a device name to be created.
+ */
+#define        DISK_LABEL_WAIT         (30 * 1000)  /* 30 seconds */
+
 #define        DEFAULT_IMPORT_PATH_SIZE        7
 extern char *zpool_default_import_path[DEFAULT_IMPORT_PATH_SIZE];
 
index e43c7c6bdeac8296d33c8856adb9fb6e76d23d3e..e2808638ef3412b403e3c3106b3eda65282de22b 100644 (file)
@@ -4080,10 +4080,10 @@ zvol_create_link_common(libzfs_handle_t *hdl, const char *dataset, int ifexists)
        }
 
        /*
-        * Wait up to 10 seconds for udev to create the device.
+        * Wait for udev to create the device.
         */
        (void) snprintf(path, sizeof (path), "%s/%s", ZVOL_DIR, dataset);
-       error = zpool_label_disk_wait(path, 10000);
+       error = zpool_label_disk_wait(path, DISK_LABEL_WAIT);
        if (error)
                (void) printf(gettext("%s may not be immediately "
                    "available\n"), path);