summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2015-07-07 16:04:18 -0500
committerDavid Teigland <teigland@redhat.com>2015-07-08 10:27:21 -0500
commit143a9d7ee690c68269572a44f4f1e396916c9b57 (patch)
tree31c3d5b36fce6cca6df14eae73807369bc0899a5
parent6e1f421a6d3a515a9720514bbcceb6789f96dd44 (diff)
downloadlvm2-143a9d7ee690c68269572a44f4f1e396916c9b57.tar.gz
toollib: skip processing the sanlock LV unless named or all
This prevents 'lvremove vgname' from attempting to remove the hidden sanlock LV. Only vgremove should remove the hidden sanlock LV holding the sanlock locks.
-rw-r--r--tools/toollib.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/toollib.c b/tools/toollib.c
index 8c301bb66..b0b2b0195 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -2135,13 +2135,26 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
}
/*
- * Only let hidden LVs through it --all was used or the LVs
+ * Only let hidden LVs through if --all was used or the LVs
* were specifically named on the command line.
*/
if (!lvargs_supplied && !lv_is_visible(lvl->lv) && !arg_count(cmd, all_ARG))
continue;
/*
+ * Only let sanlock LV through if --all was used or if
+ * it is named on the command line.
+ */
+ if (lv_is_lockd_sanlock_lv(lvl->lv)) {
+ if (arg_count(cmd, all_ARG) ||
+ (lvargs_supplied && str_list_match_item(arg_lvnames, lvl->lv->name))) {
+ log_very_verbose("Processing lockd_sanlock_lv %s/%s.", vg->name, lvl->lv->name);
+ } else {
+ continue;
+ }
+ }
+
+ /*
* process the LV if one of the following:
* - process_all is set
* - LV name matches a supplied LV name