mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 03:10:52 +07:00
fs: avoid fdput() after failed fdget() in vfs_dedupe_file_range()
It's a fairly inconsequential bug, since fdput() won't actually try to fput() the file due to fd.flags (and thus FDPUT_FPUT) being zero in the failure case, but most other vfs code takes steps to avoid this. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
60cc43fc88
commit
2276271147
@ -2023,7 +2023,7 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
|
||||
ret = mnt_want_write_file(dst_file);
|
||||
if (ret) {
|
||||
info->status = ret;
|
||||
goto next_loop;
|
||||
goto next_fdput;
|
||||
}
|
||||
|
||||
dst_off = info->dest_offset;
|
||||
@ -2058,9 +2058,9 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
|
||||
|
||||
next_file:
|
||||
mnt_drop_write_file(dst_file);
|
||||
next_loop:
|
||||
next_fdput:
|
||||
fdput(dst_fd);
|
||||
|
||||
next_loop:
|
||||
if (fatal_signal_pending(current))
|
||||
goto out;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user