1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-25 01:34:38 +03:00

Add log_error even for general device in use when we can't do the sysfs checks.

This commit is contained in:
Peter Rajnoha 2011-09-26 10:17:51 +00:00
parent 57f1027a03
commit d1f949465f
2 changed files with 18 additions and 4 deletions

View 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.",

View 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 "