diff options
| author | Eric Van Hensbergen <ericvh@gmail.com> | 2009-11-02 09:39:28 -0500 |
|---|---|---|
| committer | Eric Van Hensbergen <ericvh@gmail.com> | 2009-11-02 09:43:45 -0500 |
| commit | 3e2796a90cf349527e50b3bc4d0b2f4019b1ce7a (patch) | |
| tree | 80bddc0f5d36a589db5a77b9b60e4c94c75994ed /include | |
| parent | 2511cd0b3b9e9b1c3e9360cc565c3745ac3f3f3f (diff) | |
9p: fix readdir corner cases
The patch below also addresses a couple of other corner cases in readdir
seen with a large (e.g. 64k) msize. I'm not sure what people think of
my co-opting of fid->aux here. I'd be happy to rework if there's a better
way.
When the size of the user supplied buffer passed to readdir is smaller
than the data returned in one go by the 9P read request, v9fs_dir_readdir()
currently discards extra data so that, on the next call, a 9P read
request will be issued with offset < previous offset + bytes returned,
which voilates the constraint described in paragraph 3 of read(5) description.
This patch preseves the leftover data in fid->aux for use in the next call.
Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/9p/client.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index e26812274b75..fb00b329f0d3 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h | |||
| @@ -159,8 +159,7 @@ struct p9_client { | |||
| 159 | * @qid: the &p9_qid server identifier this handle points to | 159 | * @qid: the &p9_qid server identifier this handle points to |
| 160 | * @iounit: the server reported maximum transaction size for this file | 160 | * @iounit: the server reported maximum transaction size for this file |
| 161 | * @uid: the numeric uid of the local user who owns this handle | 161 | * @uid: the numeric uid of the local user who owns this handle |
| 162 | * @aux: transport specific information (unused?) | 162 | * @rdir: readdir accounting structure (allocated on demand) |
| 163 | * @rdir_fpos: tracks offset of file position when reading directory contents | ||
| 164 | * @flist: per-client-instance fid tracking | 163 | * @flist: per-client-instance fid tracking |
| 165 | * @dlist: per-dentry fid tracking | 164 | * @dlist: per-dentry fid tracking |
| 166 | * | 165 | * |
| @@ -174,9 +173,9 @@ struct p9_fid { | |||
| 174 | struct p9_qid qid; | 173 | struct p9_qid qid; |
| 175 | u32 iounit; | 174 | u32 iounit; |
| 176 | uid_t uid; | 175 | uid_t uid; |
| 177 | void *aux; | ||
| 178 | 176 | ||
| 179 | int rdir_fpos; | 177 | void *rdir; |
| 178 | |||
| 180 | struct list_head flist; | 179 | struct list_head flist; |
| 181 | struct list_head dlist; /* list of all fids attached to a dentry */ | 180 | struct list_head dlist; /* list of all fids attached to a dentry */ |
| 182 | }; | 181 | }; |
