From 3b3a8677d77d6db674a7ccf3805ba9b1e014e646 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Fri, 3 Nov 2023 14:11:46 -0400 Subject: [PATCH] EX-7601 osc: apply compressed flag to dst page The existing code to apply brw flags to compressed pages has two issues: 1. The dst_page is NOT an osc async page, it is a bare BRW page. This means the brw_page2oap macro isn't right, because there is no oap page. Because oap_brw_flags is actually oap_brw_page.flag, we don't ever access the memory pointed at by OAP, just use it to find an offset back in to the brw page. This means the flags are set correctly, but we still shouldn't use this macro. 2. However, the function then overwrites these flags by copying from a page in the source, so OBD_BRW_COMPRESSED is lost. Add OBD_BRW_COMPRESSED when we set flags. This ensures the flag is actually sent to the server on compressed IO. This was not causing any problems because the server does not actually use the OBD_BRW_COMPRESSED flag yet. (EX-7601 uses this flag) Signed-off-by: Patrick Farrell Change-Id: Ia94cdc803868ce16a0b66fd58578ec8b2d00cbae Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52979 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Artem Blagodarenko --- lustre/osc/osc_compress.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lustre/osc/osc_compress.c b/lustre/osc/osc_compress.c index 98c1b1d..04dcb47 100644 --- a/lustre/osc/osc_compress.c +++ b/lustre/osc/osc_compress.c @@ -116,7 +116,6 @@ int fill_cpga(struct brw_page **cpga, struct brw_page **pga, int dst_page; int src_page; struct brw_page *pg; - struct osc_async_page *oap; struct cl_page *clpage; for (chunk_offset = 0, dst_page = dst_from, src_page = src_from; @@ -128,9 +127,6 @@ int fill_cpga(struct brw_page **cpga, struct brw_page **pga, if (cpga[dst_page] == NULL) RETURN(-ENOMEM); - oap = brw_page2oap(pga[dst_page]); - oap->oap_brw_flags |= OBD_BRW_COMPRESSED; - pg = cpga[dst_page]; pg->off = pga[src_from]->off + chunk_offset; /* this asserts that every page in a compressed IO starts at @@ -167,7 +163,7 @@ int fill_cpga(struct brw_page **cpga, struct brw_page **pga, * Let's choose first page in chunk * flag to set to all pages */ - pg->flag = pga[src_from]->flag; + pg->flag = pga[src_from]->flag | OBD_BRW_COMPRESSED; if (fill_bits & CPGA_FILL_ENCRYPTED) { if (fill_bits & CPGA_FILL_DIRECTIO) { -- 1.8.3.1