Re: [PATCH v2] ocfs2: do not use make_bad_inode() in ocfs2_read_inode_block_full()
Joseph Qi <[email protected]> Thu, 9 Jul 2026 14:19:51 +0800
| Newsgroups | dev.linux.lists.ocfs2-devel |
|---|---|
| Message-ID | <[email protected]> |
On 7/9/26 2:01 PM, Dmitry Antipov wrote:
> This reverts commit 58b6fcd2ab34 ("ocfs2: mark inode bad upon
> validation failure during read").
>
> Since 'make_bad_inode()' resets inode type to S_IFREG, doing this
> for directory inode during active VFS lookup is likely to confuse
> the latter, including VFS_BUG_ON_INODE() triggered in this case.
>
> Reported-by: [email protected]
> Closes: https://syzkaller.appspot.com/bug?extid=d222f4b7129379c3d5bc
> Fixes: 58b6fcd2ab34 ("ocfs2: mark inode bad upon validation failure during read")
> Suggested-by: Al Viro <[email protected]>
> Signed-off-by: Dmitry Antipov <[email protected]>
Reviewed-by: Joseph Qi <[email protected]>
> ---
> v2: fix typo and add Fixes: tag
>
> Suggested by Al at https://syzkaller.appspot.com/text?tag=Patch&x=10c51a1a580000.
>
> I've also verified https://syzkaller.appspot.com/bug?extid=b93b65ee321c97861072
> and this issue is no longer triggered when 'make_bad_inode()' is dropped. And note
> https://lore.kernel.org/all/57qlrwjb2kxgolx4yim3jsdflunh2gvqhsqq5ttsfenbjfl4vu@3nliqvyxsnhb
> as well.
> ---
> fs/ocfs2/inode.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
> index 662dbc845b8b..b5d109cc9edc 100644
> --- a/fs/ocfs2/inode.c
> +++ b/fs/ocfs2/inode.c
> @@ -1948,8 +1948,6 @@ int ocfs2_read_inode_block_full(struct inode *inode, struct buffer_head **bh,
> rc = ocfs2_read_blocks(INODE_CACHE(inode), OCFS2_I(inode)->ip_blkno,
> 1, &tmp, flags, ocfs2_validate_inode_block);
>
> - if (rc < 0)
> - make_bad_inode(inode);
> /* If ocfs2_read_blocks() got us a new bh, pass it up. */
> if (!rc && !*bh)
> *bh = tmp;