summaryrefslogtreecommitdiff
path: root/fs/9p/vfs_dir.c
diff options
context:
space:
mode:
authorTom Zanussi <zanussi@kernel.org>2019-05-21 15:31:59 -0500
committerTom Zanussi <zanussi@kernel.org>2019-05-21 15:31:59 -0500
commit7e4eec4a8da1e85c9baebdddf4a8af31d7653263 (patch)
treee7c5db695e3a53509d4d85c9be7170cb0271b15e /fs/9p/vfs_dir.c
parent32e860e0679fce1ccfa8395df41f8790e24172b6 (diff)
parentdc3e913edf94d54de5678e726cf95b38327e5d09 (diff)
downloadlinux-rt-7e4eec4a8da1e85c9baebdddf4a8af31d7653263.tar.gz
Merge tag 'v3.18.139' into v3.18-rt-work
This is the 3.18.139 stable release
Diffstat (limited to 'fs/9p/vfs_dir.c')
-rw-r--r--fs/9p/vfs_dir.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index cfe4cf6486af..fa7d1c3536e6 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -104,7 +104,6 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
int err = 0;
struct p9_fid *fid;
int buflen;
- int reclen = 0;
struct p9_rdir *rdir;
p9_debug(P9_DEBUG_VFS, "name %pD\n", file);
@@ -129,11 +128,10 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
while (rdir->head < rdir->tail) {
err = p9stat_read(fid->clnt, rdir->buf + rdir->head,
rdir->tail - rdir->head, &st);
- if (err) {
+ if (err <= 0) {
p9_debug(P9_DEBUG_VFS, "returned %d\n", err);
return -EIO;
}
- reclen = st.size+2;
over = !dir_emit(ctx, st.name, strlen(st.name),
v9fs_qid2ino(&st.qid), dt_type(&st));
@@ -141,8 +139,8 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
if (over)
return 0;
- rdir->head += reclen;
- ctx->pos += reclen;
+ rdir->head += err;
+ ctx->pos += err;
}
}
}