From d9057cb67e1bbb3c9f3208788619797ac25aef7b Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Thu, 11 Sep 2014 06:57:52 -0400 Subject: [PATCH] LU-5287 export: hold exp_lock when modify exp_flags There are few places that changing the exp_flags without holding exp_lock, that could overwrite other concurrent exp_flags updating. Lustre-commit: 999fedbd5c18a021064b23933e84e4c92a7f48ac Lustre-change: http://review.whamcloud.com/11871 Signed-off-by: Niu Yawei Signed-off-by: Bob Glossman Change-Id: I9c0421ffeacd6bf6feaa31dca9f9fc0e7963bc8b Reviewed-on: http://review.whamcloud.com/12162 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- lustre/ldlm/ldlm_lib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 3d27f17..eb8a58b 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1085,8 +1085,10 @@ dont_check_exports: * OBD_CONNECT_MNE_SWAB flag around forever, just so long as we need * interop with unpatched 2.2 clients. For newer clients, servers * will never do MNE swabbing, let the client handle that. LU-1644 */ + spin_lock(&export->exp_lock); export->exp_need_mne_swab = !ptlrpc_req_need_swab(req) && !(data->ocd_connect_flags & OBD_CONNECT_MNE_SWAB); + spin_unlock(&export->exp_lock); #else #warning "LU-1644: Remove old OBD_CONNECT_MNE_SWAB fixup and exp_need_mne_swab" #endif -- 1.8.3.1