Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocfs2: relax BUG() to ocfs2_error() in __ocfs2_move_extent()

In '__ocfs2_move_extent()', relax 'BUG()' to 'ocfs2_error()' just
to avoid crashing the whole kernel due to a filesystem corruption.

Fixes: 8f603e567aa7 ("Ocfs2/move_extents: move a range of extent.")
Link: https://lkml.kernel.org/r/20251009102349.181126-2-dmantipov@yandex.ru
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Closes: https://syzkaller.appspot.com/bug?extid=727d161855d11d81e411
Reported-by: syzbot+727d161855d11d81e411@syzkaller.appspotmail.com
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Dmitry Antipov and committed by
Andrew Morton
8a7d5884 41a5e877

+7 -1
+7 -1
fs/ocfs2/move_extents.c
··· 98 98 99 99 rec = &el->l_recs[index]; 100 100 101 - BUG_ON(ext_flags != rec->e_flags); 101 + if (ext_flags != rec->e_flags) { 102 + ret = ocfs2_error(inode->i_sb, 103 + "Inode %llu has corrupted extent %d with flags 0x%x at cpos %u\n", 104 + (unsigned long long)ino, index, rec->e_flags, cpos); 105 + goto out; 106 + } 107 + 102 108 /* 103 109 * after moving/defraging to new location, the extent is not going 104 110 * to be refcounted anymore.