From 628d1e25ea891470487ef32054069ba997602411 Mon Sep 17 00:00:00 2001 From: Qian Yingjin Date: Mon, 6 May 2024 04:16:19 -0400 Subject: [PATCH] LU-17783 statahead: disable batch statahead for old server Disable the batch statahead for the old server that does not support MDS_BATCH batch RPC. Fixes: 4435d0121f ("LU-14139 statahead: batched statahead processing") Test-Parameters: testlist=sanity serverjob=lustre-b_es6_0 serverbuildno=638 clientdistro=el9.3 serverdistro=el8.8 env=ONLY=123 Signed-off-by: Qian Yingjin Change-Id: I79fba4204e0ed44e2bc9a4c4f2758d087f0e406b Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55017 Tested-by: Maloo Tested-by: jenkins Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Reviewed-by: Alex Zhuravlev --- lustre/include/lustre_export.h | 5 +++++ lustre/llite/statahead.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lustre/include/lustre_export.h b/lustre/include/lustre_export.h index 7216c47..8e11371 100644 --- a/lustre/include/lustre_export.h +++ b/lustre/include/lustre_export.h @@ -525,6 +525,11 @@ static inline bool exp_connect_unaligned_dio(struct obd_export *exp) return (exp_connect_flags2(exp) & OBD_CONNECT2_UNALIGNED_DIO); } +static inline bool exp_connect_batch_rpc(struct obd_export *exp) +{ + return (exp_connect_flags2(exp) & OBD_CONNECT2_BATCH_RPC); +} + enum { /* archive_ids in array format */ KKUC_CT_DATA_ARRAY_MAGIC = 0x092013cea, diff --git a/lustre/llite/statahead.c b/lustre/llite/statahead.c index 77b2c02..1379b6c 100644 --- a/lustre/llite/statahead.c +++ b/lustre/llite/statahead.c @@ -1533,7 +1533,11 @@ static int ll_statahead_thread(void *arg) CDEBUG(D_READA, "statahead thread starting: sai %p, parent %pd\n", sai, parent); - sai->sai_max_batch_count = sbi->ll_sa_batch_max; + if (exp_connect_batch_rpc(sbi->ll_md_exp)) + sai->sai_max_batch_count = sbi->ll_sa_batch_max; + else + sai->sai_max_batch_count = 0; + if (sai->sai_max_batch_count) { bh = md_batch_create(ll_i2mdexp(dir), BATCH_FL_RDONLY, sai->sai_max_batch_count); -- 1.8.3.1