Merge branch 'work.mkdir' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs icache updates from Al Viro: - NFS mkdir/open_by_handle race fix - analogous solution for FUSE, replacing the one currently in mainline - new primitive to be used when discarding halfway set up inodes on failed object creation; gives sane warranties re icache lookups not returning such doomed by still not freed inodes. A bunch of filesystems switched to that animal. - Miklos' fix for last cycle regression in iget5_locked(); -stable will need a slightly different variant, unfortunately. - misc bits and pieces around things icache-related (in adfs and jfs). * 'work.mkdir' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: jfs: don't bother with make_bad_inode() in ialloc() adfs: don't put inodes into icache new helper: inode_fake_hash() vfs: don't evict uninitialized inode jfs: switch to discard_new_inode() ext2: make sure that partially set up inodes won't be returned by ext2_iget() udf: switch to discard_new_inode() ufs: switch to discard_new_inode() btrfs: switch to discard_new_inode() new primitive: discard_new_inode() kill d_instantiate_no_diralias() nfs_instantiate(): prevent multiple aliases for directory inode
This commit is contained in:
@@ -1643,6 +1643,7 @@ int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fhandle,
|
||||
struct dentry *parent = dget_parent(dentry);
|
||||
struct inode *dir = d_inode(parent);
|
||||
struct inode *inode;
|
||||
struct dentry *d;
|
||||
int error = -EACCES;
|
||||
|
||||
d_drop(dentry);
|
||||
@@ -1664,10 +1665,12 @@ int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fhandle,
|
||||
goto out_error;
|
||||
}
|
||||
inode = nfs_fhget(dentry->d_sb, fhandle, fattr, label);
|
||||
error = PTR_ERR(inode);
|
||||
if (IS_ERR(inode))
|
||||
d = d_splice_alias(inode, dentry);
|
||||
if (IS_ERR(d)) {
|
||||
error = PTR_ERR(d);
|
||||
goto out_error;
|
||||
d_add(dentry, inode);
|
||||
}
|
||||
dput(d);
|
||||
out:
|
||||
dput(parent);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user