mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
fs/ntfs3: Stale inode instead of bad
[ Upstream commit 1fd21919de6de245b63066b8ee3cfba92e36f0e9 ] Fixed the logic of processing inode with wrong sequence number. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
84d363dbcf
commit
898c8795ec
1 changed files with 7 additions and 3 deletions
|
@ -532,11 +532,15 @@ struct inode *ntfs_iget5(struct super_block *sb, const struct MFT_REF *ref,
|
|||
if (inode->i_state & I_NEW)
|
||||
inode = ntfs_read_mft(inode, name, ref);
|
||||
else if (ref->seq != ntfs_i(inode)->mi.mrec->seq) {
|
||||
/* Inode overlaps? */
|
||||
_ntfs_bad_inode(inode);
|
||||
/*
|
||||
* Sequence number is not expected.
|
||||
* Looks like inode was reused but caller uses the old reference
|
||||
*/
|
||||
iput(inode);
|
||||
inode = ERR_PTR(-ESTALE);
|
||||
}
|
||||
|
||||
if (IS_ERR(inode) && name)
|
||||
if (IS_ERR(inode))
|
||||
ntfs_set_state(sb->s_fs_info, NTFS_DIRTY_ERROR);
|
||||
|
||||
return inode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue