Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=faebf4e2bb0efad9dda396ea13d5c6ad15d7d7fb
Commit:     faebf4e2bb0efad9dda396ea13d5c6ad15d7d7fb
Parent:     c79ba787c11e767ffaf8d723923afda99ba6c63c
Author:     Trond Myklebust <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 13 02:28:11 2007 -0500
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Sat Feb 3 15:35:05 2007 -0800

    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 <[EMAIL PROTECTED]>
---
 fs/nfs/getroot.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 8391bd7..6ef268f 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -135,17 +135,15 @@ int nfs4_path_walk(struct nfs_server *server,
        struct nfs_fh lastfh;
        struct qstr name;
        int ret;
-       //int referral_count = 0;
 
        dprintk("--> nfs4_path_walk(,,%s)\n", path);
 
        fsinfo.fattr = &fattr;
        nfs_fattr_init(&fattr);
 
-       if (*path++ != '/') {
-               dprintk("nfs4_get_root: Path does not begin with a slash\n");
-               return -EINVAL;
-       }
+       /* Eat leading slashes */
+       while (*path == '/')
+               path++;
 
        /* Start by getting the root filehandle from the server */
        ret = server->nfs_client->rpc_ops->getroot(server, mntfh, &fsinfo);
@@ -160,6 +158,7 @@ int nfs4_path_walk(struct nfs_server *server,
                return -ENOTDIR;
        }
 
+       /* FIXME: It is quite valid for the server to return a referral here */
        if (fattr.valid & NFS_ATTR_FATTR_V4_REFERRAL) {
                printk(KERN_ERR "nfs4_get_root:"
                       " getroot obtained referral\n");
@@ -187,6 +186,7 @@ eat_dot_dir:
                goto eat_dot_dir;
        }
 
+       /* FIXME: Why shouldn't the user be able to use ".." in the path? */
        if (path[0] == '.' && path[1] == '.' && (path[2] == '/' || !path[2])
            ) {
                printk(KERN_ERR "nfs4_get_root:"
@@ -212,6 +212,7 @@ eat_dot_dir:
                return -ENOTDIR;
        }
 
+       /* FIXME: Referrals are quite valid here too */
        if (fattr.valid & NFS_ATTR_FATTR_V4_REFERRAL) {
                printk(KERN_ERR "nfs4_get_root:"
                       " lookupfh obtained referral\n");
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to