From b2d006f91d7366cf74328bab46b669d49dbcc9a7 Mon Sep 17 00:00:00 2001 From: Li Dongyang Date: Tue, 16 Feb 2021 23:40:05 +1100 Subject: [PATCH] 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. Lustre-commit: f44413717eaf5cb938d9c9b2b62d312f064d282a Lustre-change: https://review.whamcloud.com/41677 Test-Parameters: trivial Change-Id: I40d481d703a46b9711021a162208b86a956bd8d1 Signed-off-by: Li Dongyang Reviewed-by: Andreas Dilger Reviewed-by: Wang Shilong Reviewed-by: Oleg Drokin Reviewed-on: https://review.whamcloud.com/41860 Tested-by: jenkins Tested-by: Maloo --- 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