Skip to content
Commit fa83c34e authored by Baokun Li's avatar Baokun Li Committed by Theodore Ts'o
Browse files

ext4: check iomap type only if ext4_iomap_begin() does not fail



When ext4_iomap_overwrite_begin() calls ext4_iomap_begin() map blocks may
fail for some reason (e.g. memory allocation failure, bare disk write), and
later because "iomap->type ! = IOMAP_MAPPED" triggers WARN_ON(). When ext4
iomap_begin() returns an error, it is normal that the type of iomap->type
may not match the expectation. Therefore, we only determine if iomap->type
is as expected when ext4_iomap_begin() is executed successfully.

Cc: stable@kernel.org
Reported-by: default avatar <syzbot+08106c4b7d60702dbc14@syzkaller.appspotmail.com>
Link: https://lore.kernel.org/all/00000000000015760b05f9b4eee9@google.com


Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230505132429.714648-1-libaokun1@huawei.com


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 4f043518
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment