diff options
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index abe4f0c8dc5f..df8c03a02161 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -439,7 +439,6 @@ void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry) | |||
439 | if (dentry == NULL) | 439 | if (dentry == NULL) |
440 | return; | 440 | return; |
441 | 441 | ||
442 | d_set_d_op(dentry, NFS_PROTO(dir)->dentry_ops); | ||
443 | inode = nfs_fhget(dentry->d_sb, entry->fh, entry->fattr); | 442 | inode = nfs_fhget(dentry->d_sb, entry->fh, entry->fattr); |
444 | if (IS_ERR(inode)) | 443 | if (IS_ERR(inode)) |
445 | goto out; | 444 | goto out; |
@@ -1193,8 +1192,6 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru | |||
1193 | if (dentry->d_name.len > NFS_SERVER(dir)->namelen) | 1192 | if (dentry->d_name.len > NFS_SERVER(dir)->namelen) |
1194 | goto out; | 1193 | goto out; |
1195 | 1194 | ||
1196 | d_set_d_op(dentry, NFS_PROTO(dir)->dentry_ops); | ||
1197 | |||
1198 | /* | 1195 | /* |
1199 | * If we're doing an exclusive create, optimize away the lookup | 1196 | * If we're doing an exclusive create, optimize away the lookup |
1200 | * but don't hash the dentry. | 1197 | * but don't hash the dentry. |
@@ -1338,7 +1335,6 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry | |||
1338 | res = ERR_PTR(-ENAMETOOLONG); | 1335 | res = ERR_PTR(-ENAMETOOLONG); |
1339 | goto out; | 1336 | goto out; |
1340 | } | 1337 | } |
1341 | d_set_d_op(dentry, NFS_PROTO(dir)->dentry_ops); | ||
1342 | 1338 | ||
1343 | /* Let vfs_create() deal with O_EXCL. Instantiate, but don't hash | 1339 | /* Let vfs_create() deal with O_EXCL. Instantiate, but don't hash |
1344 | * the dentry. */ | 1340 | * the dentry. */ |
@@ -1410,11 +1406,15 @@ no_open: | |||
1410 | static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd) | 1406 | static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd) |
1411 | { | 1407 | { |
1412 | struct dentry *parent = NULL; | 1408 | struct dentry *parent = NULL; |
1413 | struct inode *inode = dentry->d_inode; | 1409 | struct inode *inode; |
1414 | struct inode *dir; | 1410 | struct inode *dir; |
1415 | struct nfs_open_context *ctx; | 1411 | struct nfs_open_context *ctx; |
1416 | int openflags, ret = 0; | 1412 | int openflags, ret = 0; |
1417 | 1413 | ||
1414 | if (nd->flags & LOOKUP_RCU) | ||
1415 | return -ECHILD; | ||
1416 | |||
1417 | inode = dentry->d_inode; | ||
1418 | if (!is_atomic_open(nd) || d_mountpoint(dentry)) | 1418 | if (!is_atomic_open(nd) || d_mountpoint(dentry)) |
1419 | goto no_open; | 1419 | goto no_open; |
1420 | 1420 | ||
@@ -1583,6 +1583,7 @@ static int nfs_create(struct inode *dir, struct dentry *dentry, int mode, | |||
1583 | { | 1583 | { |
1584 | struct iattr attr; | 1584 | struct iattr attr; |
1585 | int error; | 1585 | int error; |
1586 | int open_flags = 0; | ||
1586 | 1587 | ||
1587 | dfprintk(VFS, "NFS: create(%s/%ld), %s\n", | 1588 | dfprintk(VFS, "NFS: create(%s/%ld), %s\n", |
1588 | dir->i_sb->s_id, dir->i_ino, dentry->d_name.name); | 1589 | dir->i_sb->s_id, dir->i_ino, dentry->d_name.name); |
@@ -1590,7 +1591,10 @@ static int nfs_create(struct inode *dir, struct dentry *dentry, int mode, | |||
1590 | attr.ia_mode = mode; | 1591 | attr.ia_mode = mode; |
1591 | attr.ia_valid = ATTR_MODE; | 1592 | attr.ia_valid = ATTR_MODE; |
1592 | 1593 | ||
1593 | error = NFS_PROTO(dir)->create(dir, dentry, &attr, 0, NULL); | 1594 | if ((nd->flags & LOOKUP_CREATE) != 0) |
1595 | open_flags = nd->intent.open.flags; | ||
1596 | |||
1597 | error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags, NULL); | ||
1594 | if (error != 0) | 1598 | if (error != 0) |
1595 | goto out_err; | 1599 | goto out_err; |
1596 | return 0; | 1600 | return 0; |