btrfs: do not BUG_ON() on tree mod log failures at push_nodes_for_insert()
authorFilipe Manana <fdmanana@suse.com>
Thu, 8 Jun 2023 10:27:46 +0000 (11:27 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:39 +0000 (13:59 +0200)
commit11d6ae03557e34dd2bc9e57d1a5139ab3c7be54f
tree83a2a791df72ec21d129f6543f276d560d38db7c
parenteced687e224eb3cc5a501cf53ad9291337c8dbc5
btrfs: do not BUG_ON() on tree mod log failures at push_nodes_for_insert()

At push_nodes_for_insert(), instead of doing a BUG_ON() in case we fail to
record tree mod log operations, do a transaction abort and return the
error to the caller. There's really no need for the BUG_ON() as we can
release all resources in this context, and we have to abort because other
future tree searches that use the tree mod log (btrfs_search_old_slot())
may get inconsistent results if other operations modify the tree after
that failure and before the tree mod log based search.

Reviewed-by: Qu Wenruo <wqu@suse.com>
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/ctree.c