From c0ff3805c884036ce70d62d718f88917a25d5651 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Tue, 29 Sep 2009 15:17:54 +0000 Subject: [PATCH] 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 prefered solution to dm tree function rewrite which affects snapshots and mirrors.) --- WHATS_NEW | 1 + lib/activate/activate.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index d1113a957..ce3f9ac99 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.54 - ===================================== + Return fail if lv_deactivate fails to remove device from kernel. Provide alternative implementation of obsolete siginterrupt(). Consolidate LV allocation into alloc_lv(). Treat input units of both 's' and 'S' as 512-byte sectors. (2.02.49) diff --git a/lib/activate/activate.c b/lib/activate/activate.c index aa75e5b28..724c1feac 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -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); -- 2.43.5