[PATCH] 9p: reset the stat buffer offset after each read

From: Latchesar Ionkov
Date: Thu Jul 23 2009 - 13:33:23 EST


The stat buffer offset variable (i) is set to zero at the beginning of
the v9fs_dir_readdir function. It should be reset to 0 each time data
is read from the file server.

Signed-off-by: Latchesar Ionkov <lucho@xxxxxxxxxx>

diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 873cd31..9b0525f 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -74,7 +74,7 @@ static int v9fs_dir_readdir(struct file *filp, void
*dirent, filldir_t filldir)
struct p9_fid *fid;
int buflen;
char *statbuf;
- int n, i = 0;
+ int n, i;

P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name);
fid = filp->private_data;
@@ -90,6 +90,7 @@ static int v9fs_dir_readdir(struct file *filp, void
*dirent, filldir_t filldir)
if (err <= 0)
break;

+ i = 0;
n = err;
while (i < n) {
err = p9stat_read(statbuf + i, buflen-i, &st,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/