Skip to content

Commit 8e3c500

Browse files
jmberg-intelAl Viro
authored andcommitted
fs/9p: fix readdir()
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 <[email protected]> Fixes: e1200fe ("9p: switch p9_client_read() to passing struct iov_iter *") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent bb66873 commit 8e3c500

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/9p/vfs_dir.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
138138
&err);
139139
if (err)
140140
return err;
141+
if (n == 0)
142+
return 0;
141143

142144
rdir->head = 0;
143145
rdir->tail = n;

0 commit comments

Comments
 (0)