From ca51e5d9ec182f9860b1e4259b0aedc1bfc8c2a6 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 28 May 2009 01:11:29 +0000 Subject: [PATCH] Remove /dev/vgname/lvname symlink automatically if LV is no longer visible. --- WHATS_NEW | 1 + lib/activate/dev_manager.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index d43ad3bc8..fe363efcd 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.48 - =============================== + Remove /dev/vgname/lvname symlink automatically if LV is no longer visible. Rename internal vorigin LV to match visible LV. Suppress 'removed' messages displayed when internal LVs are removed. Fix lvchange -a and -p for sparse LVs. diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 80b7bd4ea..5a932a696 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -1067,7 +1067,14 @@ static int _create_lv_symlinks(struct dev_manager *dm, struct dm_tree_node *root } if (!fs_rename_lv(lvlayer->lv, name, old_vgname, old_lvname)) r = 0; - } else if (!dev_manager_lv_mknodes(lvlayer->lv)) + continue; + } + if (lv_is_visible(lvlayer->lv)) { + if (!dev_manager_lv_mknodes(lvlayer->lv)) + r = 0; + continue; + } + if (!dev_manager_lv_rmnodes(lvlayer->lv)) r = 0; } -- 2.43.5