mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
ntfs: return errors from inode initialization
ntfs_iget() previously converted only -ENOMEM from ntfs_read_locked_inode() into an ERR_PTR(). Other initialization errors left the inode on the normal return path after it had been unlocked. Return every non-zero initialization error after releasing the inode reference. Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
parent
760c9d271d
commit
d7aa04984f
|
|
@ -173,10 +173,11 @@ struct inode *ntfs_iget(struct super_block *sb, u64 mft_no)
|
|||
unlock_new_inode(vi);
|
||||
}
|
||||
/*
|
||||
* There is no point in keeping bad inodes around if the failure was
|
||||
* due to ENOMEM. We want to be able to retry again later.
|
||||
* There is no point in keeping bad inodes around. This also
|
||||
* simplifies things in that we never need to check for bad inodes
|
||||
* elsewhere.
|
||||
*/
|
||||
if (unlikely(err == -ENOMEM)) {
|
||||
if (unlikely(err)) {
|
||||
iput(vi);
|
||||
vi = ERR_PTR(err);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user