linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>,
	Axel Rasmussen <axelrasmussen@google.com>,
	Peter Xu <peterx@redhat.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Lokesh Gidra <lokeshgidra@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] userfaultfd: fix UFFDIO_CONTINUE ioctl request definition
Date: Wed, 23 Jun 2021 05:42:12 +0300	[thread overview]
Message-ID: <20210623024212.GA17269@altlinux.org> (raw)
In-Reply-To: <20210601143432.1002481-1-glebfm@altlinux.org>

Hi,

On Tue, Jun 01, 2021 at 05:34:32PM +0300, Gleb Fotengauer-Malinovskiy wrote:
> This ioctl request reads from uffdio_continue structure which justifies
> _IOC_READ flag.
> See NOTEs in include/uapi/asm-generic/ioctl.h for more information.

These ioctl flag usage rules seem to be a perpetual source of mistakes.
I suggest a slightly different wording of the commit message which is
hopefully a bit easier to follow:

"This ioctl request reads from uffdio_continue structure written by
userspace which justifies _IOC_WRITE flag.  It also writes back to that
structure which justifies _IOC_READ flag.

See NOTEs in include/uapi/asm-generic/ioctl.h for more information."
 
Please make sure this patch is merged before v5.13 is released, otherwise
the UAPI bug would have to stay for backwards ABI compatibility.

> Fixes: f619147104c8 ("userfaultfd: add UFFDIO_CONTINUE ioctl")
> Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
> Acked-by: Peter Xu <peterx@redhat.com>
> ---
>  include/uapi/linux/userfaultfd.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> v2 fix commit message
> 
> diff --git a/include/uapi/linux/userfaultfd.h b/include/uapi/linux/userfaultfd.h
> index bafbeb1a2624..650480f41f1d 100644
> --- a/include/uapi/linux/userfaultfd.h
> +++ b/include/uapi/linux/userfaultfd.h
> @@ -80,8 +80,8 @@
>  				      struct uffdio_zeropage)
>  #define UFFDIO_WRITEPROTECT	_IOWR(UFFDIO, _UFFDIO_WRITEPROTECT, \
>  				      struct uffdio_writeprotect)
> -#define UFFDIO_CONTINUE		_IOR(UFFDIO, _UFFDIO_CONTINUE,	\
> -				     struct uffdio_continue)
> +#define UFFDIO_CONTINUE		_IOWR(UFFDIO, _UFFDIO_CONTINUE,	\
> +				      struct uffdio_continue)
>  
>  /* read() structure */
>  struct uffd_msg {

Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>


-- 
ldv

      parent reply	other threads:[~2021-06-23  2:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01 14:34 [PATCH v2] userfaultfd: fix UFFDIO_CONTINUE ioctl request definition Gleb Fotengauer-Malinovskiy
2021-06-01 16:41 ` Axel Rasmussen
2021-06-23  2:42 ` Dmitry V. Levin [this message]

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=20210623024212.GA17269@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=glebfm@altlinux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lokeshgidra@google.com \
    --cc=mike.kravetz@oracle.com \
    --cc=peterx@redhat.com \
    /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 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).