summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2023-06-08 11:27:43 +0100
committerDavid Sterba <dsterba@suse.com>2023-06-19 13:59:38 +0200
commit87b8e9d06e3315c6f8d478fc8fc0dc4d25cf0e09 (patch)
tree9ca162a2f4f52b275ade697c0ff3b7ed40fb2e22 /fs/btrfs/ctree.c
parentdaefe4d435d75118af302dae650547b8b760da0b (diff)
downloadlinux-87b8e9d06e3315c6f8d478fc8fc0dc4d25cf0e09.tar.gz
linux-87b8e9d06e3315c6f8d478fc8fc0dc4d25cf0e09.tar.bz2
linux-87b8e9d06e3315c6f8d478fc8fc0dc4d25cf0e09.zip
btrfs: avoid unnecessarily setting the fs to RO and error state at balance_level()
At balance_level(), when trying to promote a child node to a root node, if we fail to read the child we call btrfs_handle_fs_error(), which turns the fs to RO mode and sets it to error state as well, causing any ongoing transaction to abort. This however is not necessary because at that point we have not made any change yet at balance_level(), so any error reading the child node does not leaves us in any inconsistent state. Therefore we can just return the error to the caller. 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>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index e98f9e205e25..4dcdcf25c3fe 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1040,7 +1040,6 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
child = btrfs_read_node_slot(mid, 0);
if (IS_ERR(child)) {
ret = PTR_ERR(child);
- btrfs_handle_fs_error(fs_info, ret, NULL);
goto out;
}