Skip to content

Commit

Permalink
fs/9p: fix readdir()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jmberg-intel authored and Al Viro committed Apr 24, 2015
1 parent bb66873 commit 8e3c500
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/9p/vfs_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8e3c500

Please sign in to comment.