Skip to contentSkip to conversation

Return fail if lv_deactivate did not removed device from kernel.

PATCH New Milan Broz 2 participants 2 messages Sep 17, 2009 – Sep 28, 2009

lore
Share & tools
lore

Milan Broz

author
#0 lore raw

PATCH 1/3 Return fail if lv_deactivate did not removed device from kernel.

Return fail if lv_deactivate did not removed device from kernel.

lv_deactivate now returns always success, because tree deactivation functions (see dm_tree_deactivate_children) always returns success.

Because code should return failure in lv_deactivate at least, fix it by checking for device existence after real deactivation call.

(After discussion this was preferred solution to dm tree function rewrite which affects snapshots and mirrors.)

---
 lib/activate/activate.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
lib/activate/activate.c +2 -0
index aa75e5b..724c1fe 100644
@@ -1017,6 +1017,8 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s)
 	memlock_dec();
 	fs_unlock();
 
+	if (!lv_info(cmd, lv, &info, 1, 0) || info.exists)
+		r = 0;
 out:
 	if (lv)
 		vg_release(lv->vg);
#1 lore raw

PATCH 1/3 Return fail if lv_deactivate did not removed device from kernel.

Quoted 1 line · Milan Broz

Return fail if lv_deactivate did not removed device from kernel.

Ack.

Alasdair