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 <sunjunchao2870@xxxxxxxxx> --- fs/remap_range.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/remap_range.c b/fs/remap_range.c index 6fdeb3c8cb70..1333f67530c0 100644 --- a/fs/remap_range.c +++ b/fs/remap_range.c @@ -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); -- 2.39.2