Skip to content

Commit 1fd2191

Browse files
fs/ntfs3: Stale inode instead of bad
Fixed the logic of processing inode with wrong sequence number. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent 56c16d5 commit 1fd2191

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

fs/ntfs3/inode.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,15 @@ struct inode *ntfs_iget5(struct super_block *sb, const struct MFT_REF *ref,
536536
if (inode->i_state & I_NEW)
537537
inode = ntfs_read_mft(inode, name, ref);
538538
else if (ref->seq != ntfs_i(inode)->mi.mrec->seq) {
539-
/* Inode overlaps? */
540-
_ntfs_bad_inode(inode);
539+
/*
540+
* Sequence number is not expected.
541+
* Looks like inode was reused but caller uses the old reference
542+
*/
543+
iput(inode);
544+
inode = ERR_PTR(-ESTALE);
541545
}
542546

543-
if (IS_ERR(inode) && name)
547+
if (IS_ERR(inode))
544548
ntfs_set_state(sb->s_fs_info, NTFS_DIRTY_ERROR);
545549

546550
return inode;

0 commit comments

Comments
 (0)