]> sourceware.org Git - lvm2.git/commitdiff
Add log_error even for general device in use when we can't do the sysfs checks.
authorPeter Rajnoha <prajnoha@redhat.com>
Mon, 26 Sep 2011 10:17:51 +0000 (10:17 +0000)
committerPeter Rajnoha <prajnoha@redhat.com>
Mon, 26 Sep 2011 10:17:51 +0000 (10:17 +0000)
lib/activate/activate.c
libdm/libdm-deptree.c

index 21f597bccdfba3c5b174ca64ebcdb2121eee33f3..4ae4192648d2f14b1f1f92887259d81192f72112 100644 (file)
@@ -533,8 +533,15 @@ int lv_check_not_in_use(struct cmd_context *cmd __attribute__((unused)),
                return 1;
 
        /* If sysfs is not used, use open_count information only. */
-       if (!*dm_sysfs_dir())
-               return !info->open_count;
+       if (!*dm_sysfs_dir()) {
+               if (info->open_count) {
+                       log_error("Logical volume %s/%s in use.",
+                                 lv->vg->name, lv->name);
+                       return 0;
+               }
+
+               return 1;
+       }
 
        if (dm_device_has_holders(info->major, info->minor)) {
                log_error("Logical volume %s/%s is used by another device.",
index b1f27d8631695a727c6690dc89aefa1740493e54..c38f15c87eabbd017a0555898f37f08c68c7f931 100644 (file)
@@ -947,8 +947,15 @@ static int _check_device_not_in_use(struct dm_info *info)
                return 1;
 
        /* If sysfs is not used, use open_count information only. */
-       if (!*dm_sysfs_dir())
-               return !info->open_count;
+       if (!*dm_sysfs_dir()) {
+               if (info->open_count) {
+                       log_error("Device %" PRIu32 ":%" PRIu32 " in use",
+                                 info->major, info->minor);
+                       return 0;
+               }
+
+               return 1;
+       }
 
        if (dm_device_has_holders(info->major, info->minor)) {
                log_error("Device %" PRIu32 ":%" PRIu32 " is used "
This page took 0.033811 seconds and 5 git commands to generate.