From: Sripathi Kodi Date: Mon, 9 Aug 2010 11:33:10 +0000 (+0000) Subject: 9p: Pass the correct end of buffer to p9dirent_read X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8812a3d5f873e28cd08ec8afe328c4182b72db49;p=linux-beck.git 9p: Pass the correct end of buffer to p9dirent_read A patch was accepted recently for sending correct buffer size to p9stat_read. We need a similar patch in v9fs_dir_readdir_dotl to send correct end of buffer to p9dirent_read. Signed-off-by: Sripathi Kodi Signed-off-by: Eric Van Hensbergen --- diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index 899f168fd19c..170f5bb8ebe0 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);