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() ...
This commit is contained in:
12
fs/nfs/dir.c
12
fs/nfs/dir.c
@@ -1360,19 +1360,15 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
|
||||
dfprintk(VFS, "NFS: lookup(%pd2)\n", dentry);
|
||||
nfs_inc_stats(dir, NFSIOS_VFSLOOKUP);
|
||||
|
||||
res = ERR_PTR(-ENAMETOOLONG);
|
||||
if (dentry->d_name.len > NFS_SERVER(dir)->namelen)
|
||||
goto out;
|
||||
if (unlikely(dentry->d_name.len > NFS_SERVER(dir)->namelen))
|
||||
return ERR_PTR(-ENAMETOOLONG);
|
||||
|
||||
/*
|
||||
* If we're doing an exclusive create, optimize away the lookup
|
||||
* but don't hash the dentry.
|
||||
*/
|
||||
if (nfs_is_exclusive_create(dir, flags)) {
|
||||
d_instantiate(dentry, NULL);
|
||||
res = NULL;
|
||||
goto out;
|
||||
}
|
||||
if (nfs_is_exclusive_create(dir, flags))
|
||||
return NULL;
|
||||
|
||||
res = ERR_PTR(-ENOMEM);
|
||||
fhandle = nfs_alloc_fhandle();
|
||||
|
@@ -2461,14 +2461,15 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
|
||||
|
||||
dentry = opendata->dentry;
|
||||
if (d_really_is_negative(dentry)) {
|
||||
/* FIXME: Is this d_drop() ever needed? */
|
||||
struct dentry *alias;
|
||||
d_drop(dentry);
|
||||
dentry = d_add_unique(dentry, igrab(state->inode));
|
||||
if (dentry == NULL) {
|
||||
dentry = opendata->dentry;
|
||||
} else {
|
||||
alias = d_exact_alias(dentry, state->inode);
|
||||
if (!alias)
|
||||
alias = d_splice_alias(igrab(state->inode), dentry);
|
||||
/* d_splice_alias() can't fail here - it's a non-directory */
|
||||
if (alias) {
|
||||
dput(ctx->dentry);
|
||||
ctx->dentry = dentry;
|
||||
ctx->dentry = dentry = alias;
|
||||
}
|
||||
nfs_set_verifier(dentry,
|
||||
nfs_save_change_attribute(d_inode(opendata->dir)));
|
||||
|
Reference in New Issue
Block a user