OSDN Git Service

btrfs: Properly handle backref_in_log retval
authorNikolay Borisov <nborisov@suse.com>
Wed, 25 Sep 2019 11:03:03 +0000 (14:03 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 18 Nov 2019 11:46:51 +0000 (12:46 +0100)
commitd3316c8233bb05e0dd855d30aac347bb8ad76ee4
treee7690f6062ef838fe7b932aebd90843fa92f9310
parent89cbf5f6b6c2a5f0ac7cb83c8b3fd97eadba0d11
btrfs: Properly handle backref_in_log retval

This function can return a negative error value if btrfs_search_slot
errors for whatever reason or if btrfs_alloc_path runs out of memory.
This is currently problemattic because backref_in_log is treated by its
callers as if it returns boolean.

Fix this by adding proper error handling in callers. That also enables
the function to return the direct error code from btrfs_search_slot.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c