Whamcloud - gitweb
EX-7601 osc: only set compressed flag on compressed pages
authorPatrick Farrell <pfarrell@whamcloud.com>
Mon, 13 Nov 2023 16:18:49 +0000 (11:18 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 24 Nov 2023 09:27:08 +0000 (09:27 +0000)
The code accidentally sets the compressed flag on all
pages processed through fill_cpga, even if they're not
compressed.  Oops.

Also stop setting pg->index on the pages in the compressed
pga, this is only used by encryption and that's no longer
supported with compression.

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

index 6fd717e..91b245e 100644 (file)
@@ -91,20 +91,18 @@ int fill_cpga(struct brw_page **cpga, struct brw_page **pga,
                 * part of the incomplete pages.  This is a TODO for another
                 * patch.
                 */
-               if (dst) {
+               if (dst) /* compressed page */ {
                        pg->count = PAGE_SIZE;
                        pg->pg = mem_to_page(dst + chunk_offset);
+                       /* we get flags from the first page in the chunk and
+                        * add COMPRESSED
+                        */
+                       pg->flag = pga[src_from]->flag | OBD_BRW_COMPRESSED;
                } else {
                        pg->count = pga[src_page]->count;
                        pg->pg = pga[src_page]->pg;
+                       pg->flag = pga[src_page]->flag;
                }
-               /*
-                * Compressed pages, flags are lost
-                * Let's choose first page in chunk
-                * flag to set to all pages
-                */
-               pg->flag = pga[src_from]->flag | OBD_BRW_COMPRESSED;
-               pg->pg->index = pga[src_page]->pg->index;
 
                CDEBUG(D_SEC, "off 0x%llx, flag %x, pg %p, count %u\n",
                       pg->off, pg->flag, pg->pg, pg->count);