summaryrefslogtreecommitdiffstats
path: root/lib/locking/file_locking.c
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2011-09-27 22:43:40 +0000
committerAlasdair Kergon <agk@redhat.com>2011-09-27 22:43:40 +0000
commit10d0d9c7c468abf1144586bf50a118eb94d0c7b6 (patch)
treed6e5b73b47a074f69e011a95fc0c32af71ee85d5 /lib/locking/file_locking.c
parent74e72bd75d42ee3a24c5c094d10d9041a046fc66 (diff)
downloadlvm2-10d0d9c7c468abf1144586bf50a118eb94d0c7b6.tar.gz
lvm2-10d0d9c7c468abf1144586bf50a118eb94d0c7b6.tar.xz
lvm2-10d0d9c7c468abf1144586bf50a118eb94d0c7b6.zip
Introduce revert_lv for better pvmove cleanup.
(One further fix needed to remove the stray pvmove LVs left behind.)
Diffstat (limited to 'lib/locking/file_locking.c')
-rw-r--r--lib/locking/file_locking.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/locking/file_locking.c b/lib/locking/file_locking.c
index 93c1e1bd..468c8b50 100644
--- a/lib/locking/file_locking.c
+++ b/lib/locking/file_locking.c
@@ -257,6 +257,7 @@ static int _file_lock_resource(struct cmd_context *cmd, const char *resource,
{
char lockfile[PATH_MAX];
unsigned origin_only = (flags & LCK_ORIGIN_ONLY) ? 1 : 0;
+ unsigned revert = (flags & LCK_REVERT) ? 1 : 0;
switch (flags & LCK_SCOPE_MASK) {
case LCK_VG:
@@ -292,8 +293,8 @@ static int _file_lock_resource(struct cmd_context *cmd, const char *resource,
case LCK_LV:
switch (flags & LCK_TYPE_MASK) {
case LCK_UNLOCK:
- log_very_verbose("Unlocking LV %s%s", resource, origin_only ? " without snapshots" : "");
- if (!lv_resume_if_active(cmd, resource, origin_only, 0))
+ log_very_verbose("Unlocking LV %s%s%s", resource, origin_only ? " without snapshots" : "", revert ? " (reverting)" : "");
+ if (!lv_resume_if_active(cmd, resource, origin_only, 0, revert))
return 0;
break;
case LCK_NULL: