ext4: only set last error block when check system zone failed
hulk inclusion
category: bugfix
bugzilla: 39268
CVE: NA
-------------------------------------------------
Since the code of commit c03b42efb1c4 ("ext4: Fold ext4_data_block_valid_rcu()
into the caller") when check valid the inode blocks, we set the last error
block before final determination the block is invalid, which confuses with
linux master.
The block should be invalid only when the block is belong to the system zone.
The system zone was initialized when mount, and the entry->ino just should be
0 or journal_ino, and it never changed in his lifetime. Only when check the
inode with ino=0/journal_ino will cause set the wrong last error block.
But the ino=0/journal_ino never call ext4_inode_block_valid, so it never case
any problem.
In order to keep the same logic with linux master and dispel the confuse,
add explicit judgment for invalid block before set the last error block.
Fixes: c03b42efb1c4 ("ext4: Fold ext4_data_block_valid_rcu() into the caller")
Signed-off-by: NLuo Meng <luomeng12@huawei.com>
Reviewed-by: Nzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录