mirror of
https://github.com/torvalds/linux.git
synced 2026-09-12 20:53:03 +02:00
btrfs: send: fix lost error return value in will_overwrite_ref()
The direct-return refactoring in commitb3047a42f5("btrfs: send: directly return from will_overwrite_ref() and simplify it") changed will_overwrite_ref() to return directly instead of going through the common out label. That resulted in a negative return value from is_inode_existent() to start being converted to 0, making lookup errors unable to be distinguished from the inode not existing. process_recorded_refs() expects negative errors from will_overwrite_ref() and aborts processing when it receives one. Return the value from is_inode_existent() to restore the previous error propagation behavior as it was before the refactor. Fixes:b3047a42f5("btrfs: send: directly return from will_overwrite_ref() and simplify it") Signed-off-by: Avi Weiss <thnkslprpt@gmail.com> Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
529c01c3dc
commit
d0285dfbc3
|
|
@ -2065,7 +2065,7 @@ static int will_overwrite_ref(struct send_ctx *sctx, u64 dir, u64 dir_gen,
|
|||
|
||||
ret = is_inode_existent(sctx, dir, dir_gen, NULL, &parent_root_dir_gen);
|
||||
if (ret <= 0)
|
||||
return 0;
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* If we have a parent root we need to verify that the parent dir was
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user