From f44413717eaf5cb938d9c9b2b62d312f064d282a Mon Sep 17 00:00:00 2001 From: Li Dongyang Date: Tue, 16 Feb 2021 23:40:05 +1100 Subject: [PATCH 1/1] LU-14436 tgt: only use T10PI guard when doing full sector read The T10PI guard was generated on full sectors, if we do we partial read and still use the guard, the rpc checksum won't match. Test-Parameters: trivial Change-Id: I40d481d703a46b9711021a162208b86a956bd8d1 Signed-off-by: Li Dongyang Reviewed-on: https://review.whamcloud.com/41677 Reviewed-by: Andreas Dilger Reviewed-by: Wang Shilong Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/target/tgt_handler.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 340d491..4558c37 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -2074,6 +2074,7 @@ static int tgt_checksum_niobuf_t10pi(struct lu_target *tgt, * whole page */ if (t10_cksum_type && opc == OST_READ && + local_nb[i].lnb_len == PAGE_SIZE && local_nb[i].lnb_guard_disk) { used = DIV_ROUND_UP(local_nb[i].lnb_len, sector_size); if (used > (guard_number - used_number)) { -- 1.8.3.1