diff options
author | Andy Adamson <andros@citi.umich.edu> | 2006-06-09 09:34:30 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-09 09:34:30 -0400 |
commit | 33a43f2802d8d7be3a9b541785c4ca9ad79e4310 (patch) | |
tree | dd55121ea9031401fce8b03554654a332a4c38df /fs/nfs | |
parent | 6b97fd3da1eab2cc490cfe884c7d4956522eaf8b (diff) |
NFSv4: A root pathname is sent as a zero component4
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 646f16da072..1750d996f49 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -2408,8 +2408,10 @@ static int decode_pathname(struct xdr_stream *xdr, struct nfs4_pathname *path) | |||
2408 | 2408 | ||
2409 | READ_BUF(4); | 2409 | READ_BUF(4); |
2410 | READ32(n); | 2410 | READ32(n); |
2411 | if (n <= 0) | 2411 | if (n < 0) |
2412 | goto out_eio; | 2412 | goto out_eio; |
2413 | if (n == 0) | ||
2414 | goto root_path; | ||
2413 | dprintk("path "); | 2415 | dprintk("path "); |
2414 | path->ncomponents = 0; | 2416 | path->ncomponents = 0; |
2415 | while (path->ncomponents < n) { | 2417 | while (path->ncomponents < n) { |
@@ -2430,6 +2432,13 @@ static int decode_pathname(struct xdr_stream *xdr, struct nfs4_pathname *path) | |||
2430 | out: | 2432 | out: |
2431 | dprintk("\n"); | 2433 | dprintk("\n"); |
2432 | return status; | 2434 | return status; |
2435 | root_path: | ||
2436 | /* a root pathname is sent as a zero component4 */ | ||
2437 | path->ncomponents = 1; | ||
2438 | path->components[0].len=0; | ||
2439 | path->components[0].data=NULL; | ||
2440 | dprintk("path /\n"); | ||
2441 | goto out; | ||
2433 | out_eio: | 2442 | out_eio: |
2434 | dprintk(" status %d", status); | 2443 | dprintk(" status %d", status); |
2435 | status = -EIO; | 2444 | status = -EIO; |