From d5442c2d5ab21ca6e976be6d5491c8c395234d8f Mon Sep 17 00:00:00 2001 From: Alexander Boyko Date: Tue, 14 Jan 2025 13:02:04 +0100 Subject: [PATCH] LU-18671 mdc: don't send empty rpc for DoM osc_page_gang_lookup() sends empty rpc to refresh a lock, bases on cl_io lm_next_rpc_time from a thread storage. mdc_lock_discard_pages() does not set time, and it is taken from a osc_thread_info. Sometimes this leads to an empty rpc for a DoM, outside of DoM component size. LustreError: lustre-MDT0000-mdc-ffffa0816bceb000: operation ost_read to node 192.168.122.55@tcp failed: rc = -116 HPE-bug-id: LUS-12706 Fixes: 564070343ac4 ("LU-14711 osc: Notify server if cache discard takes a long time") Signed-off-by: Alexander Boyko Change-Id: I36cdc2c697e2306e792241ecee77b442b24356ce Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57883 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andriy Skulysh Reviewed-by: Alexey Lyashkov Reviewed-by: Oleg Drokin --- lustre/mdc/mdc_dev.c | 2 ++ lustre/osc/osc_cache.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/mdc/mdc_dev.c b/lustre/mdc/mdc_dev.c index 3370884..50e8241 100644 --- a/lustre/mdc/mdc_dev.c +++ b/lustre/mdc/mdc_dev.c @@ -229,6 +229,8 @@ static int mdc_lock_discard_pages(const struct lu_env *env, io->ci_obj = cl_object_top(osc2cl(osc)); io->ci_ignore_layout = 1; + io->u.ci_misc.lm_next_rpc_time = 0; + result = cl_io_init(env, io, CIT_MISC, io->ci_obj); if (result != 0) GOTO(out, result); diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index ea32832..2401f3c 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -3140,7 +3140,6 @@ bool osc_page_gang_lookup(const struct lu_env *env, struct cl_io *io, cl_page_get(page); pvec[j++] = ops; } - ++idx; /* * Here a delicate locking dance is performed. Current thread @@ -3182,6 +3181,7 @@ bool osc_page_gang_lookup(const struct lu_env *env, struct cl_io *io, if (need_resched()) cond_resched(); + ++idx; spin_lock(&osc->oo_tree_lock); tree_lock = true; } -- 1.8.3.1