Skip to content

Commit b98def7

Browse files
liubogithubkdave
authored andcommitted
Btrfs: bail out on error during replay_dir_deletes
If errors were returned by btrfs_next_leaf(), replay_dir_deletes needs to bail out, otherwise @ret would be forced to be 0 after 'break;' and the caller won't be aware of it. Fixes: e02119d ("Btrfs: Add a write ahead tree log to optimize synchronous operations") Reviewed-by: Nikolay Borisov <[email protected]> Signed-off-by: Liu Bo <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 80c0b42 commit b98def7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/btrfs/tree-log.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2352,8 +2352,10 @@ static noinline int replay_dir_deletes(struct btrfs_trans_handle *trans,
23522352
nritems = btrfs_header_nritems(path->nodes[0]);
23532353
if (path->slots[0] >= nritems) {
23542354
ret = btrfs_next_leaf(root, path);
2355-
if (ret)
2355+
if (ret == 1)
23562356
break;
2357+
else if (ret < 0)
2358+
goto out;
23572359
}
23582360
btrfs_item_key_to_cpu(path->nodes[0], &found_key,
23592361
path->slots[0]);

0 commit comments

Comments
 (0)