From: "Darrick J. Wong" <djwong@kernel.org>
To: John Garry <john.g.garry@oracle.com>
Cc: hch@lst.de, cem@kernel.org, dan.j.williams@intel.com,
willy@infradead.org, jack@suse.cz, brauner@kernel.org,
viro@zeniv.linux.org.uk, linux-xfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org, nvdimm@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] xfs: reject max_atomic_write mount option for no reflink
Date: Thu, 24 Jul 2025 09:32:06 -0700 [thread overview]
Message-ID: <20250724163206.GN2672029@frogsfrogsfrogs> (raw)
In-Reply-To: <20250724081215.3943871-4-john.g.garry@oracle.com>
On Thu, Jul 24, 2025 at 08:12:15AM +0000, John Garry wrote:
> If the FS has no reflink, then atomic writes greater than 1x block are not
> supported. As such, for no reflink it is pointless to accept setting
> max_atomic_write when it cannot be supported, so reject max_atomic_write
> mount option in this case.
>
> It could be still possible to accept max_atomic_write option of size 1x
> block if HW atomics are supported, so check for this specifically.
>
> Fixes: 4528b9052731 ("xfs: allow sysadmins to specify a maximum atomic write limit at mount time")
> Signed-off-by: John Garry <john.g.garry@oracle.com>
/me wonders if "mkfs: allow users to configure the desired maximum
atomic write size" needs a similar filter?
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/xfs/xfs_mount.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> index 0b690bc119d7..1ec70f4e57b4 100644
> --- a/fs/xfs/xfs_mount.c
> +++ b/fs/xfs/xfs_mount.c
> @@ -784,6 +784,25 @@ xfs_set_max_atomic_write_opt(
> return -EINVAL;
> }
>
> + if (xfs_has_reflink(mp))
> + goto set_limit;
> +
> + if (new_max_fsbs == 1) {
> + if (mp->m_ddev_targp->bt_awu_max ||
> + (mp->m_rtdev_targp && mp->m_rtdev_targp->bt_awu_max)) {
> + } else {
> + xfs_warn(mp,
> + "cannot support atomic writes of size %lluk with no reflink or HW support",
> + new_max_bytes >> 10);
> + return -EINVAL;
> + }
> + } else {
> + xfs_warn(mp,
> + "cannot support atomic writes of size %lluk with no reflink support",
> + new_max_bytes >> 10);
> + return -EINVAL;
> + }
> +
> set_limit:
> error = xfs_calc_atomic_write_reservation(mp, new_max_fsbs);
> if (error) {
> --
> 2.43.5
>
>
next prev parent reply other threads:[~2025-07-24 16:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-24 8:12 [PATCH v3 0/3] xfs and DAX atomic writes changes John Garry
2025-07-24 8:12 ` [PATCH v3 1/3] fs/dax: Reject IOCB_ATOMIC in dax_iomap_rw() John Garry
2025-07-24 16:25 ` Darrick J. Wong
2025-07-24 8:12 ` [PATCH v3 2/3] xfs: disallow atomic writes on DAX John Garry
2025-07-24 8:12 ` [PATCH v3 3/3] xfs: reject max_atomic_write mount option for no reflink John Garry
2025-07-24 16:32 ` Darrick J. Wong [this message]
2025-07-25 8:39 ` John Garry
2025-07-25 15:49 ` Darrick J. Wong
2025-08-06 9:15 ` [PATCH v3 0/3] xfs and DAX atomic writes changes John Garry
2025-08-11 12:06 ` Carlos Maiolino
2025-08-11 12:08 ` John Garry
2025-08-11 12:13 ` Carlos Maiolino
2025-08-12 7:33 ` Carlos Maiolino
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=20250724163206.GN2672029@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=brauner@kernel.org \
--cc=cem@kernel.org \
--cc=dan.j.williams@intel.com \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=john.g.garry@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/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).