summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--fs/ufs/ialloc.c3
-rw-r--r--fs/ufs/namei.c9
2 files changed, 4 insertions, 8 deletions
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c
index e1ef0f0a1353..02c0a4be4212 100644
--- a/fs/ufs/ialloc.c
+++ b/fs/ufs/ialloc.c
@@ -343,8 +343,7 @@ cg_found:
343fail_remove_inode: 343fail_remove_inode:
344 mutex_unlock(&sbi->s_lock); 344 mutex_unlock(&sbi->s_lock);
345 clear_nlink(inode); 345 clear_nlink(inode);
346 unlock_new_inode(inode); 346 discard_new_inode(inode);
347 iput(inode);
348 UFSD("EXIT (FAILED): err %d\n", err); 347 UFSD("EXIT (FAILED): err %d\n", err);
349 return ERR_PTR(err); 348 return ERR_PTR(err);
350failed: 349failed:
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)
43 return 0; 43 return 0;
44 } 44 }
45 inode_dec_link_count(inode); 45 inode_dec_link_count(inode);
46 unlock_new_inode(inode); 46 discard_new_inode(inode);
47 iput(inode);
48 return err; 47 return err;
49} 48}
50 49
@@ -142,8 +141,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
142 141
143out_fail: 142out_fail:
144 inode_dec_link_count(inode); 143 inode_dec_link_count(inode);
145 unlock_new_inode(inode); 144 discard_new_inode(inode);
146 iput(inode);
147 return err; 145 return err;
148} 146}
149 147
@@ -198,8 +196,7 @@ static int ufs_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode)
198out_fail: 196out_fail:
199 inode_dec_link_count(inode); 197 inode_dec_link_count(inode);
200 inode_dec_link_count(inode); 198 inode_dec_link_count(inode);
201 unlock_new_inode(inode); 199 discard_new_inode(inode);
202 iput (inode);
203out_dir: 200out_dir:
204 inode_dec_link_count(dir); 201 inode_dec_link_count(dir);
205 return err; 202 return err;