aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/9p/vfs_dir.c')
-rw-r--r--fs/9p/vfs_dir.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 6580aa449541..d8a3afe4ff72 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -76,6 +76,15 @@ static inline int dt_type(struct p9_wstat *mistat)
76 return rettype; 76 return rettype;
77} 77}
78 78
79static void p9stat_init(struct p9_wstat *stbuf)
80{
81 stbuf->name = NULL;
82 stbuf->uid = NULL;
83 stbuf->gid = NULL;
84 stbuf->muid = NULL;
85 stbuf->extension = NULL;
86}
87
79/** 88/**
80 * v9fs_dir_readdir - read a directory 89 * v9fs_dir_readdir - read a directory
81 * @filp: opened file structure 90 * @filp: opened file structure
@@ -131,8 +140,8 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
131 rdir->head = 0; 140 rdir->head = 0;
132 rdir->tail = err; 141 rdir->tail = err;
133 } 142 }
134
135 while (rdir->head < rdir->tail) { 143 while (rdir->head < rdir->tail) {
144 p9stat_init(&st);
136 err = p9stat_read(rdir->buf + rdir->head, 145 err = p9stat_read(rdir->buf + rdir->head,
137 buflen - rdir->head, &st, 146 buflen - rdir->head, &st,
138 fid->clnt->proto_version); 147 fid->clnt->proto_version);