summaryrefslogtreecommitdiffstats
path: root/lib/activate
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2011-09-26 10:17:51 +0000
committerPeter Rajnoha <prajnoha@redhat.com>2011-09-26 10:17:51 +0000
commitc3e5b4976d0b0bd1ed24dbc48b46f915ea316152 (patch)
treefa2778eec332918e078d9a7aba5696889114bd88 /lib/activate
parent7ae124743e94b6f93d92ffc7c599d0ea6d4980af (diff)
downloadlvm2-c3e5b4976d0b0bd1ed24dbc48b46f915ea316152.tar.gz
lvm2-c3e5b4976d0b0bd1ed24dbc48b46f915ea316152.tar.xz
lvm2-c3e5b4976d0b0bd1ed24dbc48b46f915ea316152.zip
Add log_error even for general device in use when we can't do the sysfs checks.
Diffstat (limited to 'lib/activate')
-rw-r--r--lib/activate/activate.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 21f597bc..4ae41926 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -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.",