summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorAndy Adamson <andros@citi.umich.edu>2006-06-09 09:34:30 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-06-09 09:34:30 -0400
commit33a43f2802d8d7be3a9b541785c4ca9ad79e4310 (patch)
treedd55121ea9031401fce8b03554654a332a4c38df /fs/nfs
parent6b97fd3da1eab2cc490cfe884c7d4956522eaf8b (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.c11
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)
READ_BUF(4);
READ32(n);
- if (n <= 0)
+ if (n < 0)
goto out_eio;
+ if (n == 0)
+ goto root_path;
dprintk("path ");
path->ncomponents = 0;
while (path->ncomponents < n) {
@@ -2430,6 +2432,13 @@ static int decode_pathname(struct xdr_stream *xdr, struct nfs4_pathname *path)
out:
dprintk("\n");
return status;
+root_path:
+/* a root pathname is sent as a zero component4 */
+ path->ncomponents = 1;
+ path->components[0].len=0;
+ path->components[0].data=NULL;
+ dprintk("path /\n");
+ goto out;
out_eio:
dprintk(" status %d", status);
status = -EIO;