diff options
author | David Howells <dhowells@redhat.com> | 2018-11-14 02:20:35 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-11-30 05:08:14 +0300 |
commit | 73116df7bb90435ccb2817f44113295240d15034 (patch) | |
tree | e1583099c0d913ceb2158ccdf7394f3f18e01721 /fs/afs/dir.c | |
parent | 4584ae96ae307613625e80cb9c7d9a981bed47a7 (diff) | |
download | linux-73116df7bb90435ccb2817f44113295240d15034.tar.xz |
afs: Use d_instantiate() rather than d_add() and don't d_drop()
Use d_instantiate() rather than d_add() and don't d_drop() in
afs_vnode_new_inode(). The dentry shouldn't be removed as it's not
changing its name.
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/afs/dir.c')
-rw-r--r-- | fs/afs/dir.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c index 43dea3b00c29..8a2562e3a316 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -1075,8 +1075,6 @@ static void afs_vnode_new_inode(struct afs_fs_cursor *fc, if (fc->ac.error < 0) return; - d_drop(new_dentry); - inode = afs_iget(fc->vnode->vfs_inode.i_sb, fc->key, newfid, newstatus, newcb, fc->cbi); if (IS_ERR(inode)) { @@ -1090,7 +1088,7 @@ static void afs_vnode_new_inode(struct afs_fs_cursor *fc, vnode = AFS_FS_I(inode); set_bit(AFS_VNODE_NEW_CONTENT, &vnode->flags); afs_vnode_commit_status(fc, vnode, 0); - d_add(new_dentry, inode); + d_instantiate(new_dentry, inode); } /* |