]> git.ipfire.org Git - people/ms/linux.git/blobdiff - fs/erofs/decompressor.c
Merge branch 'for-6.0/dax' into libnvdimm-fixes
[people/ms/linux.git] / fs / erofs / decompressor.c
index 6dca1900c7331de8b7c5e072a4097a57a56e1a0a..2d55569f96ace320b29edd1a7721c4e4ca94d7e4 100644 (file)
@@ -83,7 +83,7 @@ static int z_erofs_lz4_prepare_dstpages(struct z_erofs_lz4_decompress_ctx *ctx,
                        j = 0;
 
                /* 'valid' bounced can only be tested after a complete round */
-               if (test_bit(j, bounced)) {
+               if (!rq->fillgaps && test_bit(j, bounced)) {
                        DBG_BUGON(i < lz4_max_distance_pages);
                        DBG_BUGON(top >= lz4_max_distance_pages);
                        availables[top++] = rq->out[i - lz4_max_distance_pages];
@@ -91,14 +91,18 @@ static int z_erofs_lz4_prepare_dstpages(struct z_erofs_lz4_decompress_ctx *ctx,
 
                if (page) {
                        __clear_bit(j, bounced);
-                       if (kaddr) {
-                               if (kaddr + PAGE_SIZE == page_address(page))
+                       if (!PageHighMem(page)) {
+                               if (!i) {
+                                       kaddr = page_address(page);
+                                       continue;
+                               }
+                               if (kaddr &&
+                                   kaddr + PAGE_SIZE == page_address(page)) {
                                        kaddr += PAGE_SIZE;
-                               else
-                                       kaddr = NULL;
-                       } else if (!i) {
-                               kaddr = page_address(page);
+                                       continue;
+                               }
                        }
+                       kaddr = NULL;
                        continue;
                }
                kaddr = NULL;