mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Add log_error even for general device in use when we can't do the sysfs checks.
This commit is contained in:
parent
7ae124743e
commit
c3e5b4976d
@ -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.",
|
||||
|
@ -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 "
|
||||
|
Loading…
Reference in New Issue
Block a user