diff mbox

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

Message ID AANLkTim-aP_Izdt1Y7G67BuRFk9iiL6Kcym3QMjyzj6O@mail.gmail.com (mailing list archive)
State Accepted, archived
Delegated to: Eric Van Hensbergen
Headers show

Commit Message

Latchesar Ionkov July 16, 2010, 6:39 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index d61e3b2..36d961f 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -146,7 +146,7 @@  static int v9fs_dir_readdir(struct file *filp,
void *dirent, filldir_t filldir)
 		while (rdir->head < rdir->tail) {
 			p9stat_init(&st);
 			err = p9stat_read(rdir->buf + rdir->head,
-						buflen - rdir->head, &st,
+						rdir->tail - rdir->head, &st,
 						fid->clnt->proto_version);
 			if (err) {