Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 804C3C0015E for ; Tue, 1 Aug 2023 11:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=U15mjUju5E4P28Wv/BG1e1Katj9UzBZTRigBYisW7fU=; b=RNl/B5d5+5fnR/MrvZf/6JMZv5 uEb0KM99Y/4FeFWOkdRvW94zMfLHgkbcBv0HhFTeRmDgREWmiJBpAHAPFocVzhs95knu3GcY4Ha+Q bkxvWZV6x2qWUzwseYXemh9uhoW4F2mBv7KTY6oWTzH0KMoAzcv0r0IgO+UC+vKVJ1KLjWRv0cCOJ KD5S1Erl+MnLt+FEekSOn7q8hdmO9yyDlVTismOmQRqEbeWYvNqG5T87kcX7aRoFwVHU7614kIe8/ owqNNK9kNoMBpF5dAasAT5kdPlUze1jQXEGa6IlF3qoASv+x1Bb3xWFe3YsYrgtkqrKjp4+ezp3SY DtqoA0NQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQnbo-0026Wk-2f; Tue, 01 Aug 2023 11:32:12 +0000 Received: from stargate.chelsio.com ([12.32.117.8]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQnbl-0026Vs-2q for linux-nvme@lists.infradead.org; Tue, 01 Aug 2023 11:32:11 +0000 Received: from fcoe-test11.blr.asicdesigners.com (fcoe-test11.blr.asicdesigners.com [10.193.185.180]) by stargate.chelsio.com (8.14.7/8.14.7) with ESMTP id 371BVs3O009093; Tue, 1 Aug 2023 04:31:55 -0700 From: Varun Prakash To: sagi@grimberg.me, hch@lst.de Cc: linux-nvme@lists.infradead.org, varun@chelsio.com, Rakshana Sridhar Subject: [PATCH v2] nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page() Date: Tue, 1 Aug 2023 17:27:31 +0530 Message-Id: <20230801115731.4806-1-varun@chelsio.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_043209_930037_51B1E541 X-CRM114-Status: UNSURE ( 9.06 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org iov_len is the valid data length, so pass iov_len instead of sg->length to bvec_set_page(). Fixes: 5bfaba275ae6 ("nvmet-tcp: don't map pages which can't come from HIGHMEM") Signed-off-by: Rakshana Sridhar Signed-off-by: Varun Prakash --- v2: removed alignment change drivers/nvme/target/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index 868aa4de2e4c..cd92d7ddf5ed 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -348,7 +348,7 @@ static void nvmet_tcp_build_pdu_iovec(struct nvmet_tcp_cmd *cmd) while (length) { u32 iov_len = min_t(u32, length, sg->length - sg_offset); - bvec_set_page(iov, sg_page(sg), sg->length, + bvec_set_page(iov, sg_page(sg), iov_len, sg->offset + sg_offset); length -= iov_len; -- 2.31.1