mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@kernel.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, linux-fs@vger.kernel.org,
	Andy Lutomirski <luto@kernel.org>,
	David Howells <dhowells@redhat.com>
Subject: [PATCH] net/9p: Fix iov_iter usage
Date: Sat,  3 Nov 2018 20:04:28 -0700	[thread overview]
Message-ID: <f1705194dfd581fb83ec26b32626dc4ddf6039f2.1541300643.git.luto@kernel.org> (raw)

Trying to use 9pfs causes QEMU to complain:

    qemu-system-x86_64: virtio: bogus descriptor or out of resources

This happens because 9p was broken by the iov_iter refactoring because
a ! got lost.  Put it back.  The offending hunk was:

diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 7728b0acde09..4d7d2070e9c8 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -322,7 +322,7 @@ static int p9_get_mapped_pages(struct virtio_chan *chan,
 	if (!iov_iter_count(data))
 		return 0;

-	if (!(data->type & ITER_KVEC)) {
+	if (iov_iter_is_kvec(data)) {

Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Fixes: 00e23707442a ("iov_iter: Use accessor function")
Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 net/9p/trans_virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 91981970f542..b1d39cabf125 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -329,7 +329,7 @@ static int p9_get_mapped_pages(struct virtio_chan *chan,
 	if (!iov_iter_count(data))
 		return 0;
 
-	if (iov_iter_is_kvec(data)) {
+	if (!iov_iter_is_kvec(data)) {
 		int n;
 		/*
 		 * We allow only p9_max_pages pinned. We wait for the
-- 
2.17.2


             reply	other threads:[~2018-11-04  3:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-04  3:04 Andy Lutomirski [this message]
2018-11-04  3:24 ` Al Viro

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=f1705194dfd581fb83ec26b32626dc4ddf6039f2.1541300643.git.luto@kernel.org \
    --to=luto@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=linux-fs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.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

Powered by JetHome