]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: do not ignore error from btrfs_next_leaf() when inserting checksums
authorFilipe Manana <fdmanana@suse.com>
Mon, 18 May 2020 11:15:09 +0000 (12:15 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:37 +0000 (11:25 +0200)
commitd1430d675e8cad26e5fbf503c773da198b3e3d04
tree994923b17316b87e3cc4aea3921f839c2f44a733
parenta85137c553f6df0822927b97af5e5449bbefcc3a
btrfs: do not ignore error from btrfs_next_leaf() when inserting checksums

We are currently treating any non-zero return value from btrfs_next_leaf()
the same way, by going to the code that inserts a new checksum item in the
tree. However if btrfs_next_leaf() returns an error (a value < 0), we
should just stop and return the error, and not behave as if nothing has
happened, since in that case we do not have a way to know if there is a
next leaf or we are currently at the last leaf already.

So fix that by returning the error from btrfs_next_leaf().

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/file-item.c