Whamcloud - gitweb
EX-9192 csdc: Fix the upper mergeable chunk pointer
authorArtem Blagodarenko <ablagodarenko@ddn.com>
Tue, 16 Apr 2024 18:02:32 +0000 (19:02 +0100)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 27 Apr 2024 22:26:10 +0000 (22:26 +0000)
If the full chunk is followed by un mergeable page, the upper
mergeable chunk pointer is occasionally set to this unmanageable page.
The chunk size is calculated wrongly then and the next condition
suggest not to compress this chunk, because its size is not equal to
the expected size.

The pointer should be moved to the first instruction after the
can_merge_pages().

Signed-off-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Change-Id: I09fedc770c8bbcac4864b32372a941da5e0c7ac3
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54814
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/osc/osc_compress.c

index fb45ec2..5d8033b 100644 (file)
@@ -186,7 +186,6 @@ int compress_request(struct client_obd *cli, struct obdo *oa,
                        struct brw_page *pg_curr;
 
                        pg_curr = pga[curr];
-                       chunk_len = curr - chunk_start + 1;
 
                        /* these pages can't be merged, so can't be in the same
                         * chunk
@@ -205,6 +204,7 @@ int compress_request(struct client_obd *cli, struct obdo *oa,
                                break;
                        }
 
+                       chunk_len = curr - chunk_start + 1;
                        /* chunk is full, stop here */
                        if (chunk_len == pages_per_chunk) {
                                CDEBUG(D_SEC, "chunk full, [%d, %d]\n",