]> sourceware.org Git - lvm2.git/commitdiff
Never scan internal LVM devices.
authorPetr Rockai <prockai@redhat.com>
Mon, 9 Aug 2010 14:05:16 +0000 (14:05 +0000)
committerPetr Rockai <prockai@redhat.com>
Mon, 9 Aug 2010 14:05:16 +0000 (14:05 +0000)
lib/activate/dev_manager.c
lib/filters/filter-persistent.c

index 9b276160377d15b3b2f250f1f6d78e9f16eac491..e30a62e91b0538110755da02924e2e510b134582 100644 (file)
@@ -153,12 +153,17 @@ int device_is_usable(struct device *dev)
        if (!dm_task_get_info(dmt, &info))
                goto_out;
 
-       if (!info.exists || info.suspended)
+       if (!info.exists)
                goto out;
 
        name = dm_task_get_name(dmt);
        uuid = dm_task_get_uuid(dmt);
 
+       if (info.suspended && ignore_suspended_devices()) {
+               log_debug("%s: Suspended device %s not usable.", dev_name(dev), name);
+               goto out;
+       }
+
        /* FIXME Also check for mirror block_on_error and mpath no paths */
        /* For now, we exclude all mirrors */
 
@@ -166,8 +171,8 @@ int device_is_usable(struct device *dev)
                next = dm_get_next_target(dmt, next, &start, &length,
                                          &target_type, &params);
                /* Skip if target type doesn't match */
-               if (target_type && !strcmp(target_type, "mirror")) {
-                       log_debug("%s: Mirror device not usable.", dev_name(dev));
+               if (target_type && !strcmp(target_type, "mirror") && ignore_suspended_devices()) {
+                       log_debug("%s: Mirror device %s not usable.", dev_name(dev), name);
                        goto out;
                }
        } while (next);
index 5a016f84de1968b97772c02e60a7a3566f74d912..5e05d2ba38c508de587ea3e3ce2669fe7b9a3e2b 100644 (file)
@@ -279,8 +279,8 @@ static int _lookup_p(struct dev_filter *f, struct device *dev)
                if (!l)
                        dm_list_iterate_items(sl, &dev->aliases)
                                dm_hash_insert(pf->devices, sl->str, PF_GOOD_DEVICE);
-               if (ignore_suspended_devices() && !device_is_usable(dev)) {
-                       log_debug("%s: Skipping (suspended/internal)", dev_name(dev));
+               if (!device_is_usable(dev)) {
+                       log_debug("%s: Skipping unusable device", dev_name(dev));
                        return 0;
                }
                return pf->real->passes_filter(pf->real, dev);
This page took 0.040211 seconds and 5 git commands to generate.