From d7aa04984f1280efc476dbe25d6cad1c000dcfaf Mon Sep 17 00:00:00 2001 From: Hyunchul Lee Date: Fri, 21 Aug 2026 14:00:55 +0900 Subject: [PATCH] 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 Signed-off-by: Namjae Jeon --- fs/ntfs/inode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 45e013eb3541..ea97a6d028a3 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -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); }