public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
	linux-xfs@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	brauner@kernel.org, djwong@kernel.org, dchinner@redhat.com,
	linux-kernel@vger.kernel.org, ojaswin@linux.ibm.com,
	linux-ext4@vger.kernel.org
Subject: Re: [PATCH] iomap: Fix conflicting values of iomap flags
Date: Thu, 27 Mar 2025 22:04:14 +0000	[thread overview]
Message-ID: <8f1fc565-9bbb-4bbb-ab53-3c47808ef257@oracle.com> (raw)
In-Reply-To: <20250327170119.61045-1-ritesh.list@gmail.com>

On 27/03/2025 17:01, Ritesh Harjani (IBM) wrote:
> IOMAP_F_ATOMIC_BIO mistakenly took the same value as of IOMAP_F_SIZE_CHANGED
> in patch '370a6de7651b ("iomap: rework IOMAP atomic flags")'.
> Let's fix this and let's also create some more space for filesystem reported
> flags to avoid this in future. This patch makes the core iomap flags to start
> from bit 15, moving downwards. Note that "flags" member within struct iomap
> is of type u16.

Just my opinion - and others will prob disagree - but I think that the 
reason this was missed (my fault, though) was because we have separate 
grouping of flags within the same struct member. Maybe having separate 
flags altogether would help avoid this.

> 
> Fixes: 370a6de7651b ("iomap: rework IOMAP atomic flags")
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

Reviewed-by: John Garry <john.g.garry@oracle.com>

> ---
>   include/linux/iomap.h | 15 +++++++--------
>   1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/include/linux/iomap.h b/include/linux/iomap.h
> index 02fe001feebbd4..68416b135151d7 100644
> --- a/include/linux/iomap.h
> +++ b/include/linux/iomap.h
> @@ -78,6 +78,11 @@ struct vm_fault;
>   #define IOMAP_F_ANON_WRITE	(1U << 7)
>   #define IOMAP_F_ATOMIC_BIO	(1U << 8)
> 
> +/*
> + * Flag reserved for file system specific usage
> + */
> +#define IOMAP_F_PRIVATE		(1U << 12)
> +
>   /*
>    * Flags set by the core iomap code during operations:
>    *
> @@ -88,14 +93,8 @@ struct vm_fault;
>    * range it covers needs to be remapped by the high level before the operation
>    * can proceed.
>    */
> -#define IOMAP_F_SIZE_CHANGED	(1U << 8)
> -#define IOMAP_F_STALE		(1U << 9)
> -
> -/*
> - * Flags from 0x1000 up are for file system specific usage:
> - */
> -#define IOMAP_F_PRIVATE		(1U << 12)
> -
> +#define IOMAP_F_SIZE_CHANGED	(1U << 14)
> +#define IOMAP_F_STALE		(1U << 15)
> 
>   /*
>    * Magic value for addr:


  reply	other threads:[~2025-03-27 22:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-27 17:01 [PATCH] iomap: Fix conflicting values of iomap flags Ritesh Harjani (IBM)
2025-03-27 22:04 ` John Garry [this message]
2025-03-28 10:48   ` Christoph Hellwig
2025-03-28  9:45 ` Christian Brauner
2025-03-28 10:47 ` Christoph Hellwig

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=8f1fc565-9bbb-4bbb-ab53-3c47808ef257@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=brauner@kernel.org \
    --cc=dchinner@redhat.com \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=ritesh.list@gmail.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