Skip to content

Commit 7b54e08

Browse files
fdmananakdave
authored andcommitted
btrfs: fix lost error return in btrfs_find_orphan_roots()
If the call to btrfs_get_fs_root() returns an error different from -ENOENT we break out of the loop and then return 0, losing the error. Fix this by returning the error instead of breaking from the loop. Reported-by: Chris Mason <clm@meta.com> Link: https://lore.kernel.org/linux-btrfs/20260208185321.1128472-1-clm@meta.com/ Fixes: 8670a25 ("btrfs: use single return variable in btrfs_find_orphan_roots()") 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>
1 parent 29e5256 commit 7b54e08

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/btrfs/root-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info)
257257
root = btrfs_get_fs_root(fs_info, root_objectid, false);
258258
ret = PTR_ERR_OR_ZERO(root);
259259
if (ret && ret != -ENOENT) {
260-
break;
260+
return ret;
261261
} else if (ret == -ENOENT) {
262262
struct btrfs_trans_handle *trans;
263263

0 commit comments

Comments
 (0)