diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index 899f168fd19cc4d4aca48e6d26e51aa08b34db59..170f5bb8ebe08a361cd3aa241c87abb8934e5755 100644 --- a/fs/9p/vfs_dir.c +++ b/fs/9p/vfs_dir.c @@ -242,7 +242,8 @@ static int v9fs_dir_readdir_dotl(struct file *filp, void *dirent, while (rdir->head < rdir->tail) { err = p9dirent_read(rdir->buf + rdir->head, - buflen - rdir->head, &curdirent, + rdir->tail - rdir->head, + &curdirent, fid->clnt->proto_version); if (err < 0) { P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err);