From: Fan Yong Date: Mon, 28 Apr 2014 15:42:13 +0000 (+0800) Subject: LU-5122 lfsck: maintain the MDT devices list properly X-Git-Tag: 2.5.60~13 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F10507%2F3;p=fs%2Flustre-release.git LU-5122 lfsck: maintain the MDT devices list properly The layout LFSCK needs to know which MDT/OST devices have taken part in the LFSCK, it maintains two lists for that. When the layout LFSCK starts/stops, it should handle the two lists separately and properly. Signed-off-by: Fan Yong Change-Id: I26103ddc7796dbb1706f5c4da3737df297214e68 Reviewed-on: http://review.whamcloud.com/10507 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- diff --git a/lustre/lfsck/lfsck_layout.c b/lustre/lfsck/lfsck_layout.c index 98e61d236..5d619b6 100644 --- a/lustre/lfsck/lfsck_layout.c +++ b/lustre/lfsck/lfsck_layout.c @@ -1460,6 +1460,7 @@ static int lfsck_layout_master_notify_others(const struct lu_env *env, break; /* link other MDT targets locallly. */ + ltds = &lfsck->li_mdt_descs; spin_lock(<ds->ltd_lock); cfs_foreach_bit(ltds->ltd_tgts_bitmap, idx) { ltd = LTD_TGT(ltds, idx); @@ -5288,6 +5289,10 @@ static void lfsck_layout_master_data_release(const struct lu_env *env, ltd_layout_list) { list_del_init(<d->ltd_layout_list); } + spin_unlock(<ds->ltd_lock); + + ltds = &lfsck->li_mdt_descs; + spin_lock(<ds->ltd_lock); list_for_each_entry_safe(ltd, next, &llmd->llmd_mdt_phase1_list, ltd_layout_phase_list) { list_del_init(<d->ltd_layout_phase_list);