From: Fan Yong Date: Thu, 4 Dec 2014 14:00:50 +0000 (+0800) Subject: LU-6312 lfsck: modify llsd_master_list with spin_lock X-Git-Tag: 2.7.51~87 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=094030bab406b0ea5d45f711549327829b68c9cd LU-6312 lfsck: modify llsd_master_list with spin_lock There was spin_lock leak in layout LFSCK lfsck_layout_slave_quit, that may cause modifying lfsck_layout_slave_data::llsd_master_list without spin_lock when others traverses such list with spin_lock, as to the later one(s) access invalid RAM or fall into soft-lockup. Signed-off-by: Fan Yong Change-Id: I61749ebd6c36d4b21eb20bcc1c46dbe16a1c7f2c Reviewed-on: http://review.whamcloud.com/13921 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/lfsck/lfsck_layout.c b/lustre/lfsck/lfsck_layout.c index 2100784..00ef9cf 100644 --- a/lustre/lfsck/lfsck_layout.c +++ b/lustre/lfsck/lfsck_layout.c @@ -5179,6 +5179,7 @@ static void lfsck_layout_slave_quit(const struct lu_env *env, list_del_init(&llst->llst_list); spin_unlock(&llsd->llsd_lock); lfsck_layout_llst_put(llst); + spin_lock(&llsd->llsd_lock); } spin_unlock(&llsd->llsd_lock);