]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: add missing error return to btrfs_clear_extent_bit_changeset()
authorFilipe Manana <fdmanana@suse.com>
Thu, 10 Apr 2025 11:59:05 +0000 (12:59 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:50 +0000 (14:30 +0200)
commit5af1eae78d882efeaaa9a95e6ac7d70a8bf5fb9f
tree4a87938329be109d5f2bf9d98fc506bd24f77892
parent2187540b6f4d92b4bf7622244dc2cbfa61ff1855
btrfs: add missing error return to btrfs_clear_extent_bit_changeset()

We have a couple error branches where we have an error stored in the 'err'
variable and then jump to the 'out' label, however we don't return that
error, we just return 0. Normally this is not a problem since those error
branches call extent_io_tree_panic() which triggers a BUG() call, however
it's possible to have rather exotic kernel config with CONFIG_BUG disabled
in which case the BUG() call does nothing and we fallthrough. So make sure
to return the error, not just to fix that exotic case but also to make the
code less confusing. While at it also rename the 'err' variable to 'ret'
since this is the style we prefer and use more widely.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-io-tree.c