nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page()
Subsystems (2)
PATCH 1/1 nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page()
iov_len is the valid data length, so pass iov_len instead of sg->length to bvec_set_page().
--- drivers/nvme/target/tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/target/tcp.c +2 -2
@@ -348,8 +348,8 @@ 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, - sg->offset + sg_offset); +bvec_set_page (iov,sg_page (sg), iov_len, + sg->offset + sg_offset); length -= iov_len; sg =sg_next (sg);
Signature · 1 line
2.31.1
Looks good:
Sagi Grimberg
maintainerI don't see the original patch(es), Varun can you please resend and CC me?
Quoted 16 lines
iov_lenis the valid data length, so passiov_leninstead ofsg->lengthtobvec_set_page().Fixes 5bfaba275ae6 ("nvmet-tcp: don't map pages which can't come from HIGHMEM")Signed-off-by Rakshana Sridhar <[email protected]>Signed-off-by Varun Prakash <[email protected]>--- drivers/nvme/target/tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/nvme/target/tcp.c +0
-0
drivers/nvme/target/tcp.c static void nvmet_tcp_build_pdu_iovec(struct nvmet_tcp_cmd *cmd) · line 352
Quoted 7 lines
drivers/nvme/target/tcp.c +2
-2@@ -348,8 +348,8 @@ 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, - sg->offset + sg_offset); +bvec_set_page (iov,sg_page (sg), iov_len, + sg->offset + sg_offset);
The second line alignment modification is unneeded. Other than that,
Quoted 10 lines
Quoted 10 lines
drivers/nvme/target/tcp.c +0
-0@@ -348,8 +348,8 @@ 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);
Quoted 6 lines
drivers/nvme/target/tcp.c static void nvmet_tcp_build_pdu_iovec(struct nvmet_tcp_cmd *cmd) · line 352
Quoted 4 lines
drivers/nvme/target/tcp.c +2
-2-bvec_set_page (iov,sg_page (sg), sg->length, - sg->offset + sg_offset); +bvec_set_page (iov,sg_page (sg), iov_len, + sg->offset + sg_offset);The second line alignment modification is unneeded.
checkpatch.pl was reporting following CHECK warning so I fixed the alignment.
CHECK: Alignment should match open parenthesis
#27: FILE: drivers/nvme/target/tcp.c:352:
+ bvec_set_page(iov, sg_page(sg), iov_len,
sg->offset + sg_offset);
[email protected]
maintainerQuoted 1 line · Varun Prakash
checkpatch.pl was reporting following CHECK warning so I fixed the alignment.
checkpatch.pl is unfortunately not much more useful than Markus Elfring these days. Opening brace alignment is a common style and makes sense in some places, but tab-based alignment often is much easier to maintain.
Sagi Grimberg
maintainerQuoted 6 lines · On 7/31/23 22:38, [email protected] wrote:
Quoted 1 line · Varun Prakash
checkpatch.pl was reporting following CHECK warning so I fixed the alignment.
checkpatch.pl is unfortunately not much more useful than Markus Elfring these days. Opening brace alignment is a common style and makes sense in some places, but tab-based alignment often is much easier to maintain.
Yea, this warning in particular is not something that we are maintaining. Care to respin the patch?
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
checkpatch.pl was reporting following CHECK warning so I fixed the alignment.
checkpatch.pl is unfortunately not much more useful than Markus Elfring these days. Opening brace alignment is a common style and makes sense in some places, but tab-based alignment often is much easier to maintain.
Yea, this warning in particular is not something that we are maintaining. Care to respin the patch?
Ok, I will send v2.