diff options
author | Dave Wysochanski <dwysocha@redhat.com> | 2009-07-10 20:08:37 +0000 |
---|---|---|
committer | Dave Wysochanski <dwysocha@redhat.com> | 2009-07-10 20:08:37 +0000 |
commit | 03660b30454ec07c09c164f7fd23af278677324a (patch) | |
tree | 866c7099040211cf13aef4afbd68cfcc158340ab /tools/vgremove.c | |
parent | 42ae96fa3dfcc885ec6b251f2c88d8131570e5c0 (diff) | |
download | lvm2-03660b30454ec07c09c164f7fd23af278677324a.tar.gz |
Move orphan lock inside vg_remove_single.
Move the vg orphan lock inside vg_remove_single, now a complete liblvm
function. Note that this changes the order of the locks - originally
VG_ORPHAN was obtained first, then the vgname lock. With the current
policy of non-blocking second locks, this could mean we get a failure
obtaining the orphan lock. In the case of a vg with lvs being removed,
this could result in the lvs being removed but not the vg. Such a
scenario could have happened prior though with a different failure.
Other tools were examined for side-effects, and no major problems
were noted.
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Diffstat (limited to 'tools/vgremove.c')
-rw-r--r-- | tools/vgremove.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/tools/vgremove.c b/tools/vgremove.c index 1bfff1e8d..92c10fece 100644 --- a/tools/vgremove.c +++ b/tools/vgremove.c @@ -56,16 +56,9 @@ int vgremove(struct cmd_context *cmd, int argc, char **argv) return EINVALID_CMD_LINE; } - if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE)) { - log_error("Can't get lock for orphan PVs"); - return ECMD_FAILED; - } - ret = process_each_vg(cmd, argc, argv, READ_FOR_UPDATE, NULL, &vgremove_single); - unlock_vg(cmd, VG_ORPHANS); - return ret; } |