Whamcloud - gitweb
EX-8814 csdc: Update async_args after resend
authorArtem Blagodarenko <ablagodarenko@ddn.com>
Thu, 25 Jan 2024 23:01:05 +0000 (23:01 +0000)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 8 Feb 2024 08:57:36 +0000 (08:57 +0000)
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 <ablagodarenko@ddn.com>
Change-Id: Idb1c6ee9db64cb1f2ea1c1562b1c5aae443263e3
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53830
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/osc/osc_request.c

index 92155bb..9629da3 100644 (file)
@@ -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