master - raid: allow more sync action for extraction
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c465ca6a3acd2b01ddacac2275bd965bde2b4167 Commit: c465ca6a3acd2b01ddacac2275bd965bde2b4167 Parent: cac9e0b681feaf71f59ecf4f41ef724129ad61d2 Author: Zdenek Kabelac <[email protected]> AuthorDate: Sat Jun 24 22:28:25 2017 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Sat Jun 24 22:28:25 2017 +0200
raid: allow more sync action for extraction
Since we discovered status reporting from 'md' goes from large set of weird states we can't just decided based on this word. So let it pass for rebuild and idle as well
and check for health devices afterwards.
--- lib/metadata/raid_manip.c | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-)
lib/metadata/raid_manip.c +5 -8
@@ -2886,17 +2886,14 @@ static int _raid_allow_extraction(struct logical_volume *lv, !lv_raid_dev_health(lv, &dev_health)) return_0; -if (!strcmp ("idle" , sync_action)) { -log_error (INTERNAL_ERROR -"RAID LV should not be out-of-sync and \"idle\"" ); -return 0 ; - } -if (!strcmp ("resync" , sync_action))return 1 ; -/* If anything other than "recover" */ -if (strcmp ("recover" , sync_action)) { +/* If anything other than "recover", rebuild or "idle" */ +/* Targets reports for a while 'idle' state, before recover starts */ +if (strcmp ("recover" , sync_action) && +strcmp ("rebuild" , sync_action) && +strcmp ("idle" , sync_action)) {log_error ("Unable to remove RAID image while array" " is performing \"%s\"" , sync_action);return 0 ;