vfs: return -EOVERFLOW in generic_remap_checks() when overflow check fails
PATCH v2 1/1 vfs: return -EOVERFLOW in generic_remap_checks() when overflow check fails
Keep the errno value consistent with the equivalent check in generic_copy_file_checks() that returns -EOVERFLOW, which feels like the more appropriate value to return compared to the overly generic -EINVAL.
--- fs/remap_range.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/remap_range.c +1 -1
@@ -47,7 +47,7 @@ static int generic_remap_checks(struct file *file_in, loff_t pos_in,/* Ensure offsets don't wrap. */ if (check_add_overflow (pos_in, count, &tmp) ||check_add_overflow (pos_out, count, &tmp)) -return -EINVAL ; +return -EOVERFLOW ; size_in =i_size_read (inode_in); size_out =i_size_read (inode_out);
Signature · 1 line
2.39.2
Quoted 5 lines · Julian Sun
Keep the errno value consistent with the equivalent check in
generic_copy_file_checks()that returns-EOVERFLOW, which feels like the more appropriate value to return compared to the overly generic-EINVAL.Signed-off-by Julian Sun <[email protected]>
Makes sense to me. Feel free to add:
Honza
Quoted 20 lines
--- fs/remap_range.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/remap_range.c +1
-1@@ -47,7 +47,7 @@ static int generic_remap_checks(struct file *file_in, loff_t pos_in,/* Ensure offsets don't wrap. */ if (check_add_overflow (pos_in, count, &tmp) ||check_add_overflow (pos_out, count, &tmp)) -return -EINVAL ; +return -EOVERFLOW ; size_in =i_size_read (inode_in); size_out =i_size_read (inode_out);Signature · 1 line
2.39.2
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Quoted 5 lines · Julian Sun
Keep the errno value consistent with the equivalent check in
generic_copy_file_checks()that returns-EOVERFLOW, which feels like the more appropriate value to return compared to the overly generic-EINVAL.
Applied to the vfs.misc.v6.13 branch of the vfs/vfs.git tree. Patches in the vfs.misc.v6.13 branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.misc.v6.13
[1/1] vfs: return -EOVERFLOW in generic_remap_checks() when overflow check fails
https://git.kernel.org/vfs/vfs/c/53070eb468a2
Hi,
I noticed this patch hasn’t been merged into 6.13. Was it overlooked or rejected?
Quoted 17 lines · Christian Brauner <[email protected]> 于2024年9月27日周五 19:27写道:
Quoted 5 lines · Julian Sun
Keep the errno value consistent with the equivalent check in
generic_copy_file_checks()that returns-EOVERFLOW, which feels like the more appropriate value to return compared to the overly generic-EINVAL.Applied to the vfs.misc.v6.13 branch of the vfs/vfs.git tree. Patches in the vfs.misc.v6.13 branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Quoted 8 lines
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.misc.v6.13[1/1] vfs: return
-EOVERFLOWingeneric_remap_checks()when overflow check failshttps://git.kernel.org/vfs/vfs/c/53070eb468a2
Thanks,
Signature · 1 line
Julian Sun <[email protected]>
Quoted 5 lines · Julian Sun
Keep the errno value consistent with the equivalent check in
generic_copy_file_checks()that returns-EOVERFLOW, which feels like the more appropriate value to return compared to the overly generic-EINVAL.Signed-off-by Julian Sun <[email protected]>
Looks better this time :)
--D
Quoted 20 lines
--- fs/remap_range.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/remap_range.c +1
-1@@ -47,7 +47,7 @@ static int generic_remap_checks(struct file *file_in, loff_t pos_in,/* Ensure offsets don't wrap. */ if (check_add_overflow (pos_in, count, &tmp) ||check_add_overflow (pos_out, count, &tmp)) -return -EINVAL ; +return -EOVERFLOW ; size_in =i_size_read (inode_in); size_out =i_size_read (inode_out);Signature · 1 line
2.39.2