From c1117ce67f7660af912f73467639e681ab79cd01 Mon Sep 17 00:00:00 2001 From: Lai Siyao Date: Sun, 29 Sep 2024 12:31:07 -0400 Subject: [PATCH] LU-18343 lod: old client mkdir on wrong MDT Old clients may not cache default LMV, and mkdir request may be sent to wrong MDT, but MDT is too strict. Return -EREMOTE instead of -EPROTO to let old clients retry. Fixes: 6dbb4c6c8 ("LU-12998 lod: statfs upon nocreate check") Test-Parameters: mdtcount=4 clientversion=2.15 testlist=sanity env=ONLY=160a Signed-off-by: Lai Siyao Change-Id: I2e64e2b3ccd3117de163f58d697191fab4d7be1c Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56731 Reviewed-by: Emoly Liu Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Tested-by: Maloo Tested-by: jenkins --- lustre/lod/lod_object.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index 40d6ee6..7741d1d 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -6325,7 +6325,13 @@ static int lod_declare_create(const struct lu_env *env, struct dt_object *dt, lod_foreach_mdt(lod, mdt) { if (mdt->ltd_index == lo->ldo_dir_stripe_offset) { - rc = -EPROTO; + if (unlikely(hint && !hint->dah_eadata)) + /* old client may not cache DMV, + * allow it to retry. + */ + rc = -EREMOTE; + else + rc = -EPROTO; /* refresh statfs */ dt_statfs(env, mdt->ltd_tgt, &mdt->ltd_statfs); -- 1.8.3.1