From c9b640cefac04112f63637b13d7ce9fbeecd6fb0 Mon Sep 17 00:00:00 2001 From: Filipe Manana Date: Tue, 16 Dec 2025 12:41:16 +0000 Subject: [PATCH] btrfs: don't call btrfs_handle_fs_error() after failure to delete orphan item In btrfs_find_orphan_roots() we don't need to call btrfs_handle_fs_error() if we fail to delete the orphan item for the current root. This is because we haven't done anything yet regarding the current root and previous iterations of the loop dealt with other roots, so there's nothing we need to undo. Instead log an error message and return the error to the caller, which will result either in a mount failure or remount failure (the only contexts it's called from). Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/root-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index a6880ac5f0602..37a4173c0a0b7 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c @@ -272,8 +272,8 @@ int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info) ret = btrfs_del_orphan_item(trans, tree_root, root_objectid); btrfs_end_transaction(trans); if (ret) { - btrfs_handle_fs_error(fs_info, ret, - "Failed to delete root orphan item"); + btrfs_err(fs_info, + "failed to delete root orphan item: %d", ret); return ret; } continue; -- 2.47.3