mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
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: e02119d5a7
("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>
This commit is contained in:
parent
80c0b4210a
commit
b98def7ca6
1 changed files with 3 additions and 1 deletions
|
@ -2352,8 +2352,10 @@ again:
|
||||||
nritems = btrfs_header_nritems(path->nodes[0]);
|
nritems = btrfs_header_nritems(path->nodes[0]);
|
||||||
if (path->slots[0] >= nritems) {
|
if (path->slots[0] >= nritems) {
|
||||||
ret = btrfs_next_leaf(root, path);
|
ret = btrfs_next_leaf(root, path);
|
||||||
if (ret)
|
if (ret == 1)
|
||||||
break;
|
break;
|
||||||
|
else if (ret < 0)
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
btrfs_item_key_to_cpu(path->nodes[0], &found_key,
|
btrfs_item_key_to_cpu(path->nodes[0], &found_key,
|
||||||
path->slots[0]);
|
path->slots[0]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue