From: Li Dongyang Date: Tue, 16 Feb 2021 12:40:05 +0000 (+1100) Subject: LU-14436 tgt: only use T10PI guard when doing full sector read X-Git-Tag: 2.14.51~181 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f44413717eaf5cb938d9c9b2b62d312f064d282a;hp=ece23db121d94c8194fada3cf0d0d1f9d9beeed7;ds=sidebyside 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 --- 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)) {