Whamcloud - gitweb
EX-7601 osc: give compress_request explicit success
authorPatrick Farrell <pfarrell@whamcloud.com>
Tue, 21 Nov 2023 17:33:06 +0000 (12:33 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 24 Nov 2023 09:29:53 +0000 (09:29 +0000)
Compress_request has explicit failure handling, but the
success handling just follows the failure handling.  This is
confusing - on failure, we do:
page_count = *pcount
then immediately do:
*pcount = page_count

It also sets *orig_pga = pga on success OR failure, which
is wrong because compress_request may have modified pga and
then failed.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I121ec71cfe35babc4a572951e93f7581887ade80
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53119
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/osc/osc_request.c

index cb07d28..38e7ac1 100644 (file)
@@ -1615,9 +1615,10 @@ osc_brw_prep_request(int cmd, struct client_obd *cli, struct obdo *oa,
                         */
                        page_count = *pcount;
                        compressed = 0;
+               } else /* success */ {
+                       *pcount = page_count;
+                       *orig_pga = pga;
                }
-               *pcount = page_count;
-               *orig_pga = pga;
        } else if (opc == OST_READ && compressed) {
                for (i = 0; i < page_count; i++) {
                        struct brw_page *brwpg = pga[i];