summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-03-19 21:52:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-19 21:52:29 -0400
commit3c2de27d793bf55167804fc47954711e94f27be7 (patch)
treeb554e41e350adc47cf983b3103f4b4b79451f67b /fs/nfs
parent51b3eae8dbe5e6fa9657b21388ad6642d6934952 (diff)
parent8b23a8ce1094f25a85826e25217c5b9779a4f5aa (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro: - Preparations of parallel lookups (the remaining main obstacle is the need to move security_d_instantiate(); once that becomes safe, the rest will be a matter of rather short series local to fs/*.c - preadv2/pwritev2 series from Christoph - assorted fixes * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (32 commits) splice: handle zero nr_pages in splice_to_pipe() vfs: show_vfsstat: do not ignore errors from show_devname method dcache.c: new helper: __d_add() don't bother with __d_instantiate(dentry, NULL) untangle fsnotify_d_instantiate() a bit uninline d_add() replace d_add_unique() with saner primitive quota: use lookup_one_len_unlocked() cifs_get_root(): use lookup_one_len_unlocked() nfs_lookup: don't bother with d_instantiate(dentry, NULL) kill dentry_unhash() ceph_fill_trace(): don't bother with d_instantiate(dn, NULL) autofs4: don't bother with d_instantiate(dentry, NULL) in ->lookup() configfs: move d_rehash() into configfs_create() for regular files ceph: don't bother with d_rehash() in splice_dentry() namei: teach lookup_slow() to skip revalidate namei: massage lookup_slow() to be usable by lookup_one_len_unlocked() lookup_one_len_unlocked(): use lookup_dcache() namei: simplify invalidation logics in lookup_dcache() namei: change calling conventions for lookup_{fast,slow} and follow_managed() ...
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/dir.c12
-rw-r--r--fs/nfs/nfs4proc.c13
2 files changed, 11 insertions, 14 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 9cce67043f92..4bfa7d8bcade 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1360,19 +1360,15 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
1360 dfprintk(VFS, "NFS: lookup(%pd2)\n", dentry); 1360 dfprintk(VFS, "NFS: lookup(%pd2)\n", dentry);
1361 nfs_inc_stats(dir, NFSIOS_VFSLOOKUP); 1361 nfs_inc_stats(dir, NFSIOS_VFSLOOKUP);
1362 1362
1363 res = ERR_PTR(-ENAMETOOLONG); 1363 if (unlikely(dentry->d_name.len > NFS_SERVER(dir)->namelen))
1364 if (dentry->d_name.len > NFS_SERVER(dir)->namelen) 1364 return ERR_PTR(-ENAMETOOLONG);
1365 goto out;
1366 1365
1367 /* 1366 /*
1368 * If we're doing an exclusive create, optimize away the lookup 1367 * If we're doing an exclusive create, optimize away the lookup
1369 * but don't hash the dentry. 1368 * but don't hash the dentry.
1370 */ 1369 */
1371 if (nfs_is_exclusive_create(dir, flags)) { 1370 if (nfs_is_exclusive_create(dir, flags))
1372 d_instantiate(dentry, NULL); 1371 return NULL;
1373 res = NULL;
1374 goto out;
1375 }
1376 1372
1377 res = ERR_PTR(-ENOMEM); 1373 res = ERR_PTR(-ENOMEM);
1378 fhandle = nfs_alloc_fhandle(); 1374 fhandle = nfs_alloc_fhandle();
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 14881594dd07..400a70b3be7b 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2461,14 +2461,15 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
2461 2461
2462 dentry = opendata->dentry; 2462 dentry = opendata->dentry;
2463 if (d_really_is_negative(dentry)) { 2463 if (d_really_is_negative(dentry)) {
2464 /* FIXME: Is this d_drop() ever needed? */ 2464 struct dentry *alias;
2465 d_drop(dentry); 2465 d_drop(dentry);
2466 dentry = d_add_unique(dentry, igrab(state->inode)); 2466 alias = d_exact_alias(dentry, state->inode);
2467 if (dentry == NULL) { 2467 if (!alias)
2468 dentry = opendata->dentry; 2468 alias = d_splice_alias(igrab(state->inode), dentry);
2469 } else { 2469 /* d_splice_alias() can't fail here - it's a non-directory */
2470 if (alias) {
2470 dput(ctx->dentry); 2471 dput(ctx->dentry);
2471 ctx->dentry = dentry; 2472 ctx->dentry = dentry = alias;
2472 } 2473 }
2473 nfs_set_verifier(dentry, 2474 nfs_set_verifier(dentry,
2474 nfs_save_change_attribute(d_inode(opendata->dir))); 2475 nfs_save_change_attribute(d_inode(opendata->dir)));