Whamcloud - gitweb
EX-9108 obdclass: disable T10PI guard from disk when decompressing
authorLi Dongyang <dongyangli@ddn.com>
Tue, 26 Mar 2024 05:09:21 +0000 (16:09 +1100)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 30 Mar 2024 07:19:40 +0000 (07:19 +0000)
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 <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54567
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/obdclass/lustre_compr.c

index dca6e09..0ff8c1a 100644 (file)
@@ -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;
                }
        }
 }