From 3f8bfb099c234eb695a9be2699b51c7714b1a471 Mon Sep 17 00:00:00 2001 From: wang di Date: Tue, 11 Aug 2015 05:15:17 -0700 Subject: [PATCH] LU-6998 mdt: do not lock stripe0 object Do not lock stripe 0 for migrating object in mdt_lock_slaves(), because stripe0 and master object are the same object, which has been locked before mdt_lock_slaves(). Signed-off-by: wang di Change-Id: I8322061b9b8d310a17fdd6bd8265a3781b14dc9d Reviewed-on: http://review.whamcloud.com/15973 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_reint.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c index 652dba4..defdb39 100644 --- a/lustre/mdt/mdt_reint.c +++ b/lustre/mdt/mdt_reint.c @@ -470,14 +470,17 @@ static int mdt_lock_slaves(struct mdt_thread_info *mti, struct mdt_object *obj, if (le32_to_cpu(lmv->lmv_magic) != LMV_MAGIC_V1) RETURN(-EINVAL); - /* Sigh, 0_stripe and master object are different - * object, though they are in the same MDT, to avoid - * adding osd_object_lock here, so we will enqueue the - * stripe0 lock in MDT0 for now */ fid_le_to_cpu(fid, &lmv->lmv_stripe_fids[0]); - *s0_objp = mdt_object_find_lock(mti, fid, s0_lh, ibits); - if (IS_ERR(*s0_objp)) - RETURN(PTR_ERR(*s0_objp)); + if (!lu_fid_eq(fid, mdt_object_fid(obj))) { + /* Except migrating object, whose 0_stripe and master + * object are the same object, 0_stripe and master + * object are different, though they are in the same + * MDT, to avoid adding osd_object_lock here, so we + * will enqueue the stripe0 lock in MDT0 for now */ + *s0_objp = mdt_object_find_lock(mti, fid, s0_lh, ibits); + if (IS_ERR(*s0_objp)) + RETURN(PTR_ERR(*s0_objp)); + } memset(einfo, 0, sizeof(*einfo)); einfo->ei_type = LDLM_IBITS; -- 1.8.3.1