From 283f7f247b938d13e3f88567dd71869d99146208 Mon Sep 17 00:00:00 2001 From: Andriy Skulysh Date: Wed, 6 Oct 2021 13:25:12 +0300 Subject: [PATCH] LU-15119 tgt: BUG at tgt_brw_read+0x16bf/0x1d80 struct tgt_thread_big_cache { local = {{ lnb_file_offset = 0, lnb_page_offset = 0, lnb_len = 0, lnb_rc = 0, lnb_page = 0xffffddee74fae100, so npages_read becomes 0 Change-Id: Ie2201c9fc6f0350b1c6dcb480cff52f44d5413db HPE-bug-id: LUS-10510 Signed-off-by: Andriy Skulysh Reviewed-by: Alexander Boyko Reviewed-by: Shaun Tancheff Reviewed-on: https://review.whamcloud.com/45273 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- lustre/target/tgt_handler.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 3f3a3b5..5e97949 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -1948,6 +1948,9 @@ static int check_read_checksum(struct niobuf_local *local_nb, int npages, enum cksum_types cksum_type; loff_t start, end; + if (unlikely(npages <= 0)) + return 0; + /* unlikely to happen and only if resend does not occur due to cksum * control failure on Client */ if (unlikely(server_cksum == client_cksum)) { -- 1.8.3.1