diff mbox

[V9fs-developer] 9p: Pass the correct end of buffer to p9dirent_read

Message ID 20100809113310.6427.40503.stgit@sripathi.in.ibm.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Sripathi Kodi Aug. 9, 2010, 11:33 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 16c8a2a..616150f 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);