From: Jeff Layton <jlayton@redhat.com>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] iov_iter: add missing handling for ITER_KVEC in iov_iter_single_seg_count
Date: Fri, 6 Jan 2017 10:59:22 -0500 [thread overview]
Message-ID: <1483718362-18147-1-git-send-email-jlayton@redhat.com> (raw)
This seems to currently work by happenstance since kvec and iovec fields
basically the same, but it's probably better to make this explicit.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
lib/iov_iter.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index f2bd21b93dfc..6b415b5a100d 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -738,6 +738,8 @@ size_t iov_iter_single_seg_count(const struct iov_iter *i)
return i->count;
else if (i->type & ITER_BVEC)
return min(i->count, i->bvec->bv_len - i->iov_offset);
+ else if (i->type & ITER_KVEC)
+ return min(i->count, i->kvec->iov_len - i->iov_offset);
else
return min(i->count, i->iov->iov_len - i->iov_offset);
}
--
2.7.4
reply other threads:[~2017-01-06 15:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1483718362-18147-1-git-send-email-jlayton@redhat.com \
--to=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ftp.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®