Avoid gcc -Werror=maybe-uninitialized warnings
[zfs.git] / module / zfs / vdev_disk.c
index c562256..cbf0a4d 100644 (file)
@@ -121,8 +121,15 @@ vdev_elevator_switch(vdev_t *v, char *elevator)
        char *device = bdev->bd_disk->disk_name;
        int error;
 
-       /* Skip devices which are not whole disks (partitions) */
-       if (!v->vdev_wholedisk)
+       /*
+        * Skip devices which are not whole disks (partitions).
+        * Device-mapper devices are excepted since they may be whole
+        * disks despite the vdev_wholedisk flag, in which case we can
+        * and should switch the elevator. If the device-mapper device
+        * does not have an elevator (i.e. dm-raid, dm-crypt, etc.) the
+        * "Skip devices without schedulers" check below will fail.
+        */
+       if (!v->vdev_wholedisk && strncmp(device, "dm-", 3) != 0)
                return (0);
 
        /* Skip devices without schedulers (loop, ram, dm, etc) */
@@ -152,7 +159,7 @@ vdev_elevator_switch(vdev_t *v, char *elevator)
                char *envp[] = { NULL };
 
                argv[2] = kmem_asprintf(SET_SCHEDULER_CMD, device, elevator);
-               error = call_usermodehelper(argv[0], argv, envp, 1);
+               error = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
                strfree(argv[2]);
        }
 #endif /* HAVE_ELEVATOR_CHANGE */
@@ -533,7 +540,6 @@ retry:
                if (dr->dr_bio_count == i) {
                        vdev_disk_dio_free(dr);
                        bio_count *= 2;
-                       printk("WARNING: Resized bio's/dio to %d\n",bio_count);
                        goto retry;
                }