linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] vfs: return -EOVERFLOW in generic_remap_checks() when overflow check fails
@ 2024-09-27  6:53 Julian Sun
  2024-09-27 10:55 ` Jan Kara
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Julian Sun @ 2024-09-27  6:53 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: chandan.babu, djwong, viro, brauner, jack, hch, 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 <sunjunchao2870@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] vfs: return -EOVERFLOW in generic_remap_checks() when overflow check fails
  2024-09-27  6:53 [PATCH v2] vfs: return -EOVERFLOW in generic_remap_checks() when overflow check fails Julian Sun
@ 2024-09-27 10:55 ` Jan Kara
  2024-09-27 11:27 ` Christian Brauner
  2024-09-27 15:27 ` Darrick J. Wong
  2 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2024-09-27 10:55 UTC (permalink / raw)
  To: Julian Sun; +Cc: linux-fsdevel, chandan.babu, djwong, viro, brauner, jack, hch

On Fri 27-09-24 14:53:25, Julian Sun wrote:
> 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@gmail.com>

Makes sense to me. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  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
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] vfs: return -EOVERFLOW in generic_remap_checks() when overflow check fails
  2024-09-27  6:53 [PATCH v2] vfs: return -EOVERFLOW in generic_remap_checks() when overflow check fails Julian Sun
  2024-09-27 10:55 ` Jan Kara
@ 2024-09-27 11:27 ` Christian Brauner
  2025-01-06  8:35   ` Julian Sun
  2024-09-27 15:27 ` Darrick J. Wong
  2 siblings, 1 reply; 5+ messages in thread
From: Christian Brauner @ 2024-09-27 11:27 UTC (permalink / raw)
  To: linux-fsdevel, Julian Sun
  Cc: Christian Brauner, chandan.babu, djwong, viro, jack, hch

On Fri, 27 Sep 2024 14:53:25 +0800, Julian Sun wrote:
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] vfs: return -EOVERFLOW in generic_remap_checks() when overflow check fails
  2024-09-27  6:53 [PATCH v2] vfs: return -EOVERFLOW in generic_remap_checks() when overflow check fails Julian Sun
  2024-09-27 10:55 ` Jan Kara
  2024-09-27 11:27 ` Christian Brauner
@ 2024-09-27 15:27 ` Darrick J. Wong
  2 siblings, 0 replies; 5+ messages in thread
From: Darrick J. Wong @ 2024-09-27 15:27 UTC (permalink / raw)
  To: Julian Sun; +Cc: linux-fsdevel, chandan.babu, viro, brauner, jack, hch

On Fri, Sep 27, 2024 at 02:53:25PM +0800, Julian Sun wrote:
> 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@gmail.com>

Looks better this time :)
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  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
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] vfs: return -EOVERFLOW in generic_remap_checks() when overflow check fails
  2024-09-27 11:27 ` Christian Brauner
@ 2025-01-06  8:35   ` Julian Sun
  0 siblings, 0 replies; 5+ messages in thread
From: Julian Sun @ 2025-01-06  8:35 UTC (permalink / raw)
  To: Christian Brauner; +Cc: linux-fsdevel

Hi,

I noticed this patch hasn’t been merged into 6.13. Was it overlooked
or rejected?

Christian Brauner <brauner@kernel.org> 于2024年9月27日周五 19:27写道:
>
> On Fri, 27 Sep 2024 14:53:25 +0800, Julian Sun wrote:
> > 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


Thanks,
-- 
Julian Sun <sunjunchao2870@gmail.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-06  8:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-27  6:53 [PATCH v2] vfs: return -EOVERFLOW in generic_remap_checks() when overflow check fails Julian Sun
2024-09-27 10:55 ` Jan Kara
2024-09-27 11:27 ` Christian Brauner
2025-01-06  8:35   ` Julian Sun
2024-09-27 15:27 ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).