From: Johannes Berg <johannes@sipsolutions.net>
To: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org
Cc: j@w1.fi, Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH] fs/9p: fix readdir()
Date: Wed, 22 Apr 2015 11:55:14 +0200 [thread overview]
Message-ID: <1429696514-14779-1-git-send-email-johannes@sipsolutions.net> (raw)
From: Johannes Berg <johannes.berg@intel.com>
Al Viro's IOV changes broke 9p readdir() because the new code
didn't abort the read when it returned nothing. The original
code checked if the combined error/length was <= 0 but in the
new code that accidentally got changed to just an error check.
Add back the return from the function when nothing is read.
Cc: Al Viro <viro@zeniv.linux.org.uk>
Fixes: e1200fe68f20 ("9p: switch p9_client_read() to passing struct iov_iter *")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
fs/9p/vfs_dir.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 76c3b1ab6361..5cc00e56206e 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -138,6 +138,8 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
&err);
if (err)
return err;
+ if (n == 0)
+ return 0;
rdir->head = 0;
rdir->tail = n;
--
2.1.4
next reply other threads:[~2015-04-22 9:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-22 9:55 Johannes Berg [this message]
2015-04-22 13:43 ` 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=1429696514-14779-1-git-send-email-johannes@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=j@w1.fi \
--cc=johannes.berg@intel.com \
--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
all inboxes | Powered by JetHome®