Skip to content

Commit

Permalink
ufs: switch to discard_new_inode()
Browse files Browse the repository at this point in the history
we don't want open-by-handle to pick an in-core inode that
has failed setup halfway through.

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Aug 3, 2018
1 parent 32955c5 commit dd54992
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions fs/ufs/ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,7 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode)
fail_remove_inode:
mutex_unlock(&sbi->s_lock);
clear_nlink(inode);
unlock_new_inode(inode);
iput(inode);
discard_new_inode(inode);
UFSD("EXIT (FAILED): err %d\n", err);
return ERR_PTR(err);
failed:
Expand Down
9 changes: 3 additions & 6 deletions fs/ufs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit dd54992

Please sign in to comment.