From 90979ab390a72a084f6a77cf7fdc29a4329adb41 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Thu, 14 Jan 2021 16:43:34 -0700 Subject: [PATCH] LU-12125 mds: allow parallel directory rename Allow rename of subdirectories in the same parent directory to be done in parallel, by only taking the DLM lock on the parent FID, without locking the global LUSTRE_BFL_FID (Big Filesystem Lock). There will still be proper serialization from the parent directory FID lock for other rename operations affecting that directory or the subdirectories themselves. Since the subdirectories are known to be within the same parent, there is no concern of "finding the parent" to determine locking order. The same compatibility rules apply as with parallel file renames. We no longer need the target file type in this case, since the source and target file type are verfied to be the same under lock. We may again need a file type check for regular file renames across different parent directories/shards, so it may still be useful. Test-Parameters: testlist=racer env=DURATION=3600 Signed-off-by: Andreas Dilger Change-Id: I9db8acb515f5274fa09f5a5f3d18504d4d3ebbe5 Reviewed-on: https://review.whamcloud.com/41230 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_reint.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c index 670beef..4d95a60 100644 --- a/lustre/mdt/mdt_reint.c +++ b/lustre/mdt/mdt_reint.c @@ -2608,12 +2608,12 @@ static int mdt_reint_rename(struct mdt_thread_info *info, mdt_object_remote(msrcdir)) GOTO(out_put_tgtdir, rc = -EXDEV); - /* This may be further relaxed in the future for different - * source and target parents. Start with only same-directory - * renames of non-directory files for simplicity and because - * this is by far the most common use case. + /* This might be further relaxed in the future for regular file + * renames in different source and target parents. Start with + * only same-directory renames for simplicity and because this + * is by far the most the common use case. */ - if (msrcdir != mtgtdir || S_ISDIR(ma->ma_attr.la_mode)) { + if (msrcdir != mtgtdir) { rc = mdt_rename_lock(info, &rename_lh); if (rc != 0) { CERROR("%s: cannot lock for rename: rc = %d\n", -- 1.8.3.1