diff options
author | Filipe Manana <fdmanana@suse.com> | 2021-10-14 17:26:04 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2021-10-26 19:08:06 +0200 |
commit | 10adb1152d957a4d570ad630f93a88bb961616c1 (patch) | |
tree | b910f37d699adcdca903afcd16c0e33ce2c9eee7 /fs/btrfs/tree-log.c | |
parent | f4f39fc5dc30d62625ad951b48dca2576f50768f (diff) | |
download | lwn-10adb1152d957a4d570ad630f93a88bb961616c1.tar.gz lwn-10adb1152d957a4d570ad630f93a88bb961616c1.zip |
btrfs: fix lost error handling when replaying directory deletes
At replay_dir_deletes(), if find_dir_range() returns an error we break out
of the main while loop and then assign a value of 0 (success) to the 'ret'
variable, resulting in completely ignoring that an error happened. Fix
that by jumping to the 'out' label when find_dir_range() returns an error
(negative value).
CC: stable@vger.kernel.org # 4.4+
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index cda7bb2e9a1e..7c900eb27cf8 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -2528,7 +2528,9 @@ again: else { ret = find_dir_range(log, path, dirid, key_type, &range_start, &range_end); - if (ret != 0) + if (ret < 0) + goto out; + else if (ret > 0) break; } |