]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: change handle_fs_error in recover_log_trees to aborts
authorJosef Bacik <josef@toxicpanda.com>
Tue, 5 Oct 2021 20:35:23 +0000 (16:35 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Oct 2021 17:08:05 +0000 (19:08 +0200)
commit4c4f8c073dfe4b2da10f6dc4e74c2e72cead05b3
tree563b00976c44f3e0ac606ce957baa39a599fe4be
parentd95bf13c26fb9a0729adb1a216a1a6b446e45b7d
btrfs: change handle_fs_error in recover_log_trees to aborts

During inspection of the return path for replay I noticed that we don't
actually abort the transaction if we get a failure during replay.  This
isn't a problem necessarily, as we properly return the error and will
fail to mount.  However we still leave this dangling transaction that
could conceivably be committed without thinking there was an error.

We were using btrfs_handle_fs_error() here, but that pre-dates the
transaction abort code.  Simply replace the btrfs_handle_fs_error()
calls with transaction aborts, so we still know where exactly things
went wrong, and add a few in some other un-handled error cases.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c