Skip to content

Commit b406439

Browse files
fdmananagregkh
authored andcommitted
btrfs: fix lost error handling when replaying directory deletes
commit 10adb11 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8992aab commit b406439

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎fs/btrfs/tree-log.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2466,7 +2466,9 @@ static noinline int replay_dir_deletes(struct btrfs_trans_handle *trans,
24662466
else {
24672467
ret = find_dir_range(log, path, dirid, key_type,
24682468
&range_start, &range_end);
2469-
if (ret != 0)
2469+
if (ret < 0)
2470+
goto out;
2471+
else if (ret > 0)
24702472
break;
24712473
}
24722474

0 commit comments

Comments
 (0)