Whamcloud - gitweb
EX-9873 obdclass: reset bits after decompression
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 4 Jun 2024 17:59:09 +0000 (20:59 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 6 Jun 2024 08:19:07 +0000 (08:19 +0000)
as uncompressed data can be less than chunk/page, but still be
visiable to userspace as a part of a sparse file.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I4114b0704fb685013f4e03cf2d80ccde2cc8c87f
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55308
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/obdclass/lustre_compr.c

index 44b0e9d..c3cdb26 100644 (file)
@@ -527,14 +527,15 @@ void unmerge_chunk(struct brw_page **pga, struct niobuf_local *lnb, int first,
                kaddr = kmap_atomic(vmpage);
                memcpy(kaddr, merged + (i << PAGE_SHIFT),
                       PAGE_SIZE);
-               kunmap_atomic(kaddr);
                if (left < PAGE_SIZE) {
                        *pg_len = left;
                        left = 0;
+                       memset(kaddr + *pg_len, 0, PAGE_SIZE - *pg_len);
                } else {
                        *pg_len = PAGE_SIZE;
                        left -= PAGE_SIZE;
                }
+               kunmap_atomic(kaddr);
                /* we just put data in this page, so set the rc
                 * and disable guard from disk
                 */