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: e02119d5a7b4 ("Btrfs: Add a write ahead tree log to optimize synchronous operations")
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by Liu Bo and committed by David Sterba b98def7c 80c0b421

+3 -1
+3 -1
fs/btrfs/tree-log.c
··· 2352 nritems = btrfs_header_nritems(path->nodes[0]); 2353 if (path->slots[0] >= nritems) { 2354 ret = btrfs_next_leaf(root, path); 2355 - if (ret) 2356 break; 2357 } 2358 btrfs_item_key_to_cpu(path->nodes[0], &found_key, 2359 path->slots[0]);
··· 2352 nritems = btrfs_header_nritems(path->nodes[0]); 2353 if (path->slots[0] >= nritems) { 2354 ret = btrfs_next_leaf(root, path); 2355 + if (ret == 1) 2356 break; 2357 + else if (ret < 0) 2358 + goto out; 2359 } 2360 btrfs_item_key_to_cpu(path->nodes[0], &found_key, 2361 path->slots[0]);