aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-01-13 02:28:11 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-03 18:35:05 -0500
commitfaebf4e2bb0efad9dda396ea13d5c6ad15d7d7fb (patch)
tree7e0d0af02aa188b508af18c59dddbec81ecc5da7
parentc79ba787c11e767ffaf8d723923afda99ba6c63c (diff)
NFSv4: Don't require that NFSv4 mount paths begin with '/'
Addresses the regression noted in http://bugzilla.linux-nfs.org/show_bug.cgi?id=134 Also mark a couple of other regressions as requiring fixing. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/getroot.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 8391bd7a83ce..6ef268f7c300 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -135,17 +135,15 @@ int nfs4_path_walk(struct nfs_server *server,
135 struct nfs_fh lastfh; 135 struct nfs_fh lastfh;
136 struct qstr name; 136 struct qstr name;
137 int ret; 137 int ret;
138 //int referral_count = 0;
139 138
140 dprintk("--> nfs4_path_walk(,,%s)\n", path); 139 dprintk("--> nfs4_path_walk(,,%s)\n", path);
141 140
142 fsinfo.fattr = &fattr; 141 fsinfo.fattr = &fattr;
143 nfs_fattr_init(&fattr); 142 nfs_fattr_init(&fattr);
144 143
145 if (*path++ != '/') { 144 /* Eat leading slashes */
146 dprintk("nfs4_get_root: Path does not begin with a slash\n"); 145 while (*path == '/')
147 return -EINVAL; 146 path++;
148 }
149 147
150 /* Start by getting the root filehandle from the server */ 148 /* Start by getting the root filehandle from the server */
151 ret = server->nfs_client->rpc_ops->getroot(server, mntfh, &fsinfo); 149 ret = server->nfs_client->rpc_ops->getroot(server, mntfh, &fsinfo);
@@ -160,6 +158,7 @@ int nfs4_path_walk(struct nfs_server *server,
160 return -ENOTDIR; 158 return -ENOTDIR;
161 } 159 }
162 160
161 /* FIXME: It is quite valid for the server to return a referral here */
163 if (fattr.valid & NFS_ATTR_FATTR_V4_REFERRAL) { 162 if (fattr.valid & NFS_ATTR_FATTR_V4_REFERRAL) {
164 printk(KERN_ERR "nfs4_get_root:" 163 printk(KERN_ERR "nfs4_get_root:"
165 " getroot obtained referral\n"); 164 " getroot obtained referral\n");
@@ -187,6 +186,7 @@ eat_dot_dir:
187 goto eat_dot_dir; 186 goto eat_dot_dir;
188 } 187 }
189 188
189 /* FIXME: Why shouldn't the user be able to use ".." in the path? */
190 if (path[0] == '.' && path[1] == '.' && (path[2] == '/' || !path[2]) 190 if (path[0] == '.' && path[1] == '.' && (path[2] == '/' || !path[2])
191 ) { 191 ) {
192 printk(KERN_ERR "nfs4_get_root:" 192 printk(KERN_ERR "nfs4_get_root:"
@@ -212,6 +212,7 @@ eat_dot_dir:
212 return -ENOTDIR; 212 return -ENOTDIR;
213 } 213 }
214 214
215 /* FIXME: Referrals are quite valid here too */
215 if (fattr.valid & NFS_ATTR_FATTR_V4_REFERRAL) { 216 if (fattr.valid & NFS_ATTR_FATTR_V4_REFERRAL) {
216 printk(KERN_ERR "nfs4_get_root:" 217 printk(KERN_ERR "nfs4_get_root:"
217 " lookupfh obtained referral\n"); 218 " lookupfh obtained referral\n");