From deee8e1a4ba5c705526a85e149e5a411c5341fb2 Mon Sep 17 00:00:00 2001 From: Li Dongyang Date: Tue, 26 Mar 2024 16:09:21 +1100 Subject: [PATCH] EX-9108 obdclass: disable T10PI guard from disk when decompressing When server handles chunk unaligned read, we need to read the chunk from disk and decompress the raw data. This means we should not use the guard tags from the storage, as they only match the raw data. Disable the guard from disk and the T10PI checksum will be recalculated later using decompressed data. Change-Id: I49964e1412e9d02769797c64aab290b17851e26f Signed-off-by: Li Dongyang Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54567 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Artem Blagodarenko --- lustre/obdclass/lustre_compr.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lustre/obdclass/lustre_compr.c b/lustre/obdclass/lustre_compr.c index dca6e09..0ff8c1a 100644 --- a/lustre/obdclass/lustre_compr.c +++ b/lustre/obdclass/lustre_compr.c @@ -535,9 +535,13 @@ void unmerge_chunk(struct brw_page **pga, struct niobuf_local *lnb, int first, *pg_len = PAGE_SIZE; left -= PAGE_SIZE; } - /* we just put data in this page, so set the rc */ - if (lnb) + /* we just put data in this page, so set the rc + * and disable guard from disk + */ + if (lnb) { lnb[first + i].lnb_rc = *pg_len; + lnb[first + i].lnb_guard_disk = 0; + } CDEBUG(D_SEC, "pg_len: %u, left %u\n", *pg_len, left); } @@ -548,6 +552,7 @@ void unmerge_chunk(struct brw_page **pga, struct niobuf_local *lnb, int first, i, lnb[first + i].lnb_file_offset, lnb[first + i].lnb_rc); memset(kmap(lnb[i].lnb_page), 0, PAGE_SIZE); kunmap(lnb[i].lnb_page); + lnb[i].lnb_guard_disk = 0; } } } -- 1.8.3.1