]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: unify the error handling of btrfs_read_buffer()
authorQu Wenruo <wqu@suse.com>
Tue, 22 Feb 2022 07:41:20 +0000 (15:41 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Mar 2022 12:13:53 +0000 (13:13 +0100)
commitf2f0f08aa424edff017f208971dd81026ace71a8
treeb5bd70802000d419c8d24a804eb216aa763ac2ca
parentbcf94297b825d5a5de0349819657d1afbca1f003
btrfs: unify the error handling of btrfs_read_buffer()

There is one oddball error handling of btrfs_read_buffer():

ret = btrfs_read_buffer(tmp, gen, parent_level - 1, &first_key);
if (!ret) {
*eb_ret = tmp;
return 0;
}
free_extent_buffer(tmp);
btrfs_release_path(p);
return -EIO;

While all other call sites check the error first.  Unify the behavior.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c