NFS: Pass in lookup flags from nfs_atomic_open to nfs_lookup
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 20 Aug 2013 15:59:41 +0000 (11:59 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 22 Aug 2013 12:58:17 +0000 (08:58 -0400)
When doing an open of a directory, ensure that we do pass the lookup flags
from nfs_atomic_open into nfs_lookup.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/dir.c

index be3da6fe3ad46c72d0fd4efe88ba9ffdb908e45d..29d5463dcd656ab07ce92f4b5f00969846c0df65 100644 (file)
@@ -1407,6 +1407,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
        struct dentry *res;
        struct iattr attr = { .ia_valid = ATTR_OPEN };
        struct inode *inode;
+       unsigned int lookup_flags = 0;
        int err;
 
        /* Expect a negative dentry */
@@ -1429,6 +1430,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
                         */
                        return -ENOENT;
                }
+               lookup_flags = LOOKUP_OPEN|LOOKUP_DIRECTORY;
                goto no_open;
        }
 
@@ -1479,7 +1481,7 @@ out:
        return err;
 
 no_open:
-       res = nfs_lookup(dir, dentry, 0);
+       res = nfs_lookup(dir, dentry, lookup_flags);
        err = PTR_ERR(res);
        if (IS_ERR(res))
                goto out;