All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@suse.de>
To: Yi Xie <xieyi@kylinos.cn>, axboe@kernel.dk
Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yi Xie <xieyi@kylinos.cn>
Subject: Re: [PATCH] io_uring/memmap: return PTR_ERR() from get_unmapped_area()
Date: Tue, 30 Jun 2026 05:00:20 -0400	[thread overview]
Message-ID: <87jyrg5rob.fsf@mailhost.krisman.be> (raw)
In-Reply-To: <20260630065700.97360-1-xieyi@kylinos.cn>

Yi Xie <xieyi@kylinos.cn> writes:

> Use PTR_ERR() on validate failure, like io_uring_mmap().

FWIW, this is not about using PTR_ERR, but about changing the return on
error to -EINVAL, which is what is returned by
io_uring_validate_mmap_request.  The commit message should reflect that,
specially because this is returned to userspace eventually, and might
break some application checks..


> Signed-off-by: Yi Xie <xieyi@kylinos.cn>
> ---
>  io_uring/memmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/io_uring/memmap.c b/io_uring/memmap.c
> index da1f6c5d07f8..23e8a85111bc 100644
> --- a/io_uring/memmap.c
> +++ b/io_uring/memmap.c
> @@ -337,7 +337,7 @@ unsigned long io_uring_get_unmapped_area(struct file *filp, unsigned long addr,
>  
>  	ptr = io_uring_validate_mmap_request(filp, pgoff);
>  	if (IS_ERR(ptr))
> -		return -ENOMEM;
> +		return PTR_ERR(ptr);
>  
>  	/*
>  	 * Some architectures have strong cache aliasing requirements.
> -- 
> 2.25.1
>

-- 
Gabriel Krisman Bertazi

  reply	other threads:[~2026-06-30  9:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30  6:57 [PATCH] io_uring/memmap: return PTR_ERR() from get_unmapped_area() Yi Xie
2026-06-30  9:00 ` Gabriel Krisman Bertazi [this message]
2026-06-30  9:12 ` [PATCH v2] io_uring/memmap: return -EINVAL from get_unmapped_area() on bad mmap Yi Xie
2026-07-01 11:42   ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jyrg5rob.fsf@mailhost.krisman.be \
    --to=krisman@suse.de \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xieyi@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.