summaryrefslogtreecommitdiff
path: root/fs/ufs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-05-16 12:22:50 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-08-03 16:03:30 -0400
commitdd54992776ebb44519ba4cd69145c4f19d166ddb (patch)
treedf63e8fc13515e6531d103b459d76672c340abdd /fs/ufs/namei.c
parent32955c5422a8a5460bbefe2a6fc51eadcafff4c9 (diff)
ufs: switch to discard_new_inode()
we don't want open-by-handle to pick an in-core inode that has failed setup halfway through. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs/namei.c')
-rw-r--r--fs/ufs/namei.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c
index d5f43ba76c59..9ef40f100415 100644
--- a/fs/ufs/namei.c
+++ b/fs/ufs/namei.c
@@ -43,8 +43,7 @@ static inline int ufs_add_nondir(struct dentry *dentry, struct inode *inode)
return 0;
}
inode_dec_link_count(inode);
- unlock_new_inode(inode);
- iput(inode);
+ discard_new_inode(inode);
return err;
}
@@ -142,8 +141,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
out_fail:
inode_dec_link_count(inode);
- unlock_new_inode(inode);
- iput(inode);
+ discard_new_inode(inode);
return err;
}
@@ -198,8 +196,7 @@ static int ufs_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode)
out_fail:
inode_dec_link_count(inode);
inode_dec_link_count(inode);
- unlock_new_inode(inode);
- iput (inode);
+ discard_new_inode(inode);
out_dir:
inode_dec_link_count(dir);
return err;