From 43857ff98142e4daa3844dfeb487598fde718590 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Fri, 22 Sep 2023 18:33:14 -0400 Subject: [PATCH] EX-8189 osc: do not compress resends There's some issue with doing compression on resent requests, so this patch works around it with two things: 1. Use the uncompressed page array for resend (this was always necessary unless we modified resend to know it already had compressed pages as input) 2. Disable compression on resend (not clear why 1. wasn't enough) Signed-off-by: Patrick Farrell Change-Id: I5fbbdc2771f8c2c7b5c28f0b70d89b8b6015147f Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52484 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Artem Blagodarenko Reviewed-by: Andreas Dilger --- lustre/osc/osc_request.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 1f20e23..c7b9d50 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1556,6 +1556,9 @@ osc_brw_prep_request(int cmd, struct client_obd *cli, struct obdo *oa, * pages, so it is enough to check only one */ compressed = clpage->cp_comp_type != LL_COMPR_TYPE_NONE; + + if (resend) + compressed = false; } if (OBD_FAIL_CHECK(OBD_FAIL_OSC_BRW_PREP_REQ)) RETURN(-ENOMEM); /* Recoverable */ @@ -2464,16 +2467,30 @@ 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; + struct brw_page ***ppga; + u32 *page_count; + ENTRY; /* The below message is checked in replay-ost-single.sh test_8ae*/ DEBUG_REQ(rc == -EINPROGRESS ? D_RPCTRACE : D_ERROR, request, "redo for recoverable error %d", rc); + /* if the request was compressed previously, we have to redo with the + * original arrays (ideally we'd reuse the compressed ones) + */ + if (aa->aa_ncppga) { + ppga = &aa->aa_ncppga; + page_count = &aa->aa_ncpage_count; + } else { + ppga = &aa->aa_ppga; + page_count = &aa->aa_page_count; + } + rc = osc_brw_prep_request(lustre_msg_get_opc(request->rq_reqmsg) == - OST_WRITE ? OBD_BRW_WRITE : OBD_BRW_READ, - aa->aa_cli, aa->aa_oa, &aa->aa_page_count, - &aa->aa_ppga, &new_req, 1); + OST_WRITE ? OBD_BRW_WRITE : OBD_BRW_READ, + aa->aa_cli, aa->aa_oa, page_count, ppga, + &new_req, 1); if (rc) RETURN(rc); -- 1.8.3.1