From 5560f06887c816292bd7d9315c93d66762f60d12 Mon Sep 17 00:00:00 2001 From: wangdi Date: Fri, 15 Nov 2013 19:05:28 -0800 Subject: [PATCH] LU-2700 mdt: serializing the rename BFL is needed in the rename process even though the source and target are under the same directory, because we still need serialize the locking of these two objects. Signed-off-by: wang di Change-Id: I61593e3902f1f81ac282c020d912fdf28ce2cc2c Reviewed-on: http://review.whamcloud.com/5203 Tested-by: Hudson Tested-by: Maloo Tested-by: Oleg Drokin Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev --- lustre/mdt/mdt_reint.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c index 5aa043b..e342b20 100644 --- a/lustre/mdt/mdt_reint.c +++ b/lustre/mdt/mdt_reint.c @@ -986,12 +986,10 @@ static int mdt_reint_rename(struct mdt_thread_info *info, PFID(rr->rr_fid1), rr->rr_name, PFID(rr->rr_fid2), rr->rr_tgt); - if (!lu_fid_eq(rr->rr_fid1, rr->rr_fid2)) { - rc = mdt_rename_lock(info, &rename_lh); - if (rc) { - CERROR("Can't lock FS for rename, rc %d\n", rc); - RETURN(rc); - } + rc = mdt_rename_lock(info, &rename_lh); + if (rc) { + CERROR("Can't lock FS for rename, rc %d\n", rc); + RETURN(rc); } lh_newp = &info->mti_lh[MDT_LH_NEW]; -- 1.8.3.1