From 6479ba45e099beab27439f189773c80455c1a88d Mon Sep 17 00:00:00 2001 From: Artem Blagodarenko Date: Thu, 25 Jan 2024 23:01:05 +0000 Subject: [PATCH] EX-8814 csdc: Update async_args after resend It is decided to send an uncompressed request on redo. osc_brw_prep_request() processes uncompressed data and prepares a request, so some parts of the old request are outdated. Let's update the old request with information from the new one. Fixes: 8fb8d5b ("EX-8814 csdc: Revert "EX-8189 osc: do not compress resends") Signed-off-by: Artem Blagodarenko Change-Id: Idb1c6ee9db64cb1f2ea1c1562b1c5aae443263e3 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53830 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Patrick Farrell Reviewed-by: Andreas Dilger --- lustre/osc/osc_request.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 92155bb..9629da3 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -2538,6 +2538,7 @@ static int osc_brw_redo_request(struct ptlrpc_request *request, struct ptlrpc_request *new_req; struct osc_brw_async_args *new_aa; struct osc_async_page *oap; + bool compressed = false; struct brw_page ***ppga; u32 *page_count; @@ -2551,6 +2552,7 @@ static int osc_brw_redo_request(struct ptlrpc_request *request, * original arrays (ideally we'd reuse the compressed ones) */ if (aa->aa_ncppga) { + compressed = true; ppga = &aa->aa_ncppga; page_count = &aa->aa_ncpage_count; } else { @@ -2578,6 +2580,16 @@ static int osc_brw_redo_request(struct ptlrpc_request *request, */ aa->aa_resends++; new_req->rq_interpret_reply = request->rq_interpret_reply; + + if (compressed) { + new_aa = ptlrpc_req_async_args(new_aa, new_req); + /* + * These structures were changed during the resent because + * some conditions (like, the fact a request is not + * compressed on a resend) are differ. + */ + aa->aa_requested_nob = new_aa->aa_requested_nob; + } new_req->rq_async_args = request->rq_async_args; new_req->rq_commit_cb = request->rq_commit_cb; /* cap resend delay to the current request timeout, this is similar to -- 1.8.3.1