master - raid: add temporary activation for raid metadata clear
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ef6c5795a0b0502b5ef984233fbeb73a9d81f2d0 Commit: ef6c5795a0b0502b5ef984233fbeb73a9d81f2d0 Parent: ef557b8091ff67f38424d3f8413f3a543275b01d Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Feb 4 14:47:52 2014 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Feb 4 14:51:05 2014 +0100
raid: add temporary activation for raid metadata clear
Use LV_TEMPORARY when activating devices for clearing raid metadata.
--- WHATS_NEW | 1 + lib/metadata/raid_manip.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.106 - ==================================== + Avoid exposing temporary devices when initializing raid metadata volumes. Add internal tags command to display any tags defined on the host. Prohibit use of external origin with size incompatible with thin pool. Avoid trying to convert single to thin pool and volume at the same time.
lib/metadata/raid_manip.c +4 -2
@@ -174,11 +174,13 @@ static int _clear_lv(struct logical_volume *lv)if (test_mode ())return 1 ; -if (!was_active && !activate_lv_excl_local (lv->vg->cmd, lv)) { -log_error ("Failed to activate %s for clearing" , + lv->status |=LV_TEMPORARY ; +if (!was_active && !activate_lv_local (lv->vg->cmd, lv)) { +log_error ("Failed to activate localy %s for clearing" , lv->name);return 0 ; } + lv->status &= ~LV_TEMPORARY ;log_verbose ("Clearing metadata area of %s/%s" , lv->vg->name, lv->name);