]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: handle errors while updating refcounts in update_ref_for_cow
authorJeff Mahoney <jeffm@suse.com>
Tue, 21 Nov 2017 18:58:49 +0000 (13:58 -0500)
committerDavid Sterba <dsterba@suse.com>
Wed, 6 Dec 2017 23:30:03 +0000 (00:30 +0100)
commite238ecc7ee0ccd65e93601542cb6a5ad10fc0e51
treed0551d6dbe14a4cd142fd36ffb0ada36d7ef5362
parent471fa20526cda98dd5e3e81fc7ce8b0c2a37f254
btrfs: handle errors while updating refcounts in update_ref_for_cow

Since commit 225e6bc06eb (btrfs: qgroup: Move half of the qgroup
accounting time out of commit trans) the assumption that
btrfs_add_delayed_{data,tree}_ref can only return 0 or -ENOMEM has
been false.  The qgroup operations call into btrfs_search_slot
and friends and can now return the full spectrum of error codes.

Fortunately, the fix here is easy since update_ref_for_cow failing
is already handled so we just need to bail early with the error
code.

Fixes: 225e6bc06eb (btrfs: qgroup: Move half of the qgroup accounting ...)
Cc: <stable@vger.kernel.org> # v4.11+
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Edmund Nadolski <enadolski@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c