Skip to contentSkip to conversation

Never activate hidden volumes directly in vgchange.

PATCH New Milan Broz 2 participants 2 messages Oct 9, 2009 – Oct 19, 2009

lore
Share & tools
lore

Milan Broz

author
#0 lore raw

PATCH 1/1 Never activate hidden volumes directly in vgchange.

Never activate hidden volumes directly in vgchange.

All hidden (not visible) volumes should be activated through other visible volumes.

(There are already exceptions like snapshot, mirror log and image, which should be cleaned one day...)

This solves problems for future types of hidden volumes, which can have special meaning and must not be activated implicitly (e.g. key store volume).

---
  tools/vgchange.c |    3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)
tools/vgchange.c +3 -0
index 07d5262..9445263 100644
@@ -61,6 +61,9 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd,
  	dm_list_iterate_items(lvl,&vg->lvs) {
  		lv = lvl->lv;
 
+		if (!lv_is_visible(lv))
+			continue;
+
  		/* Only request activation of snapshot origin devices */
  		if ((lv->status&  SNAPSHOT) || lv_is_cow(lv))
  			continue;
#1 lore raw

PATCH 1/1 Never activate hidden volumes directly in vgchange.

Quoted 24 lines · Milan Broz

Never activate hidden volumes directly in vgchange.

All hidden (not visible) volumes should be activated through other visible volumes.

(There are already exceptions like snapshot, mirror log and image, which should be cleaned one day...)

This solves problems for future types of hidden volumes, which can have special meaning and must not be activated implicitly (e.g. key store volume).

---
  tools/vgchange.c |    3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)
tools/vgchange.c +0 -0
index 07d5262..9445263 100644

tools/vgchange.c static int _activate_lvs_in_vg(struct cmd_context *cmd, · line 69

Quoted 9 lines
tools/vgchange.c +3 -0
@@ -61,6 +61,9 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd,
  	dm_list_iterate_items(lvl,&vg->lvs) {
  		lv = lvl->lv;
 
+		if (!lv_is_visible(lv))
+			continue;
+
  		/* Only request activation of snapshot origin devices */
  		if ((lv->status&  SNAPSHOT) || lv_is_cow(lv))
  			continue;

Ack. Why not remove the redundant check(s) such as mirror log, etc along with this patch?