From: Christoph Hellwig <hch@lst.de>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: Keith Busch <kbusch@kernel.org>, Christoph Hellwig <hch@lst.de>,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme-tcp: fix possible data corruption with bio merges
Date: Wed, 13 Jan 2021 19:31:42 +0100 [thread overview]
Message-ID: <20210113183142.GA19254@lst.de> (raw)
In-Reply-To: <20210113182449.1580181-1-sagi@grimberg.me>
> static inline size_t nvme_tcp_req_cur_length(struct nvme_tcp_request *req)
> {
> - return min_t(size_t, req->iter.bvec->bv_len - req->iter.iov_offset,
> - req->pdu_len - req->pdu_sent);
> + return min_t(size_t, req->iter.count,
> + min_t(size_t, req->iter.bvec->bv_len - req->iter.iov_offset,
> + req->pdu_len - req->pdu_sent));
We are not supposed to directly poke into an iov_iter.
I suspect this should be something like:
return min_t(size_t, iov_iter_single_seg_count(&req->iter),
req->pdu_len - req->pdu_sent);
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2021-01-13 18:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-13 18:24 [PATCH] nvme-tcp: fix possible data corruption with bio merges Sagi Grimberg
2021-01-13 18:31 ` Christoph Hellwig [this message]
2021-01-13 21:56 ` Sagi Grimberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210113183142.GA19254@lst.de \
--to=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.