btrfs: handle memory allocation failure in btrfs_csum_one_bio
stable inclusion from stable-v5.10.185 commit 3bc883132d03c3a8daf1794ef0c2fa8067e5fe1d category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8L5XP Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3bc883132d03c3a8daf1794ef0c2fa8067e5fe1d -------------------------------- [ Upstream commit 806570c0 ] Since f8a53bb5 ("btrfs: handle checksum generation in the storage layer") the failures of btrfs_csum_one_bio() are handled via bio_end_io(). This means, we can return BLK_STS_RESOURCE from btrfs_csum_one_bio() in case the allocation of the ordered sums fails. This also fixes a syzkaller report, where injecting a failure into the kvzalloc() call results in a BUG_ON(). Reported-by:<syzbot+d8941552e21eac774778@syzkaller.appspotmail.com> Reviewed-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Anand Jain <anand.jain@oracle.com> Signed-off-by:
Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by:
David Sterba <dsterba@suse.com> Signed-off-by:
David Sterba <dsterba@suse.com> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment