[PATCH] xfs: don't reset max_atomic_write on a remount without the option
From: Yifan Feng
Date: Wed Dec 02 2026 - 16:08:39 EST
xfs_fs_reconfigure() applies the max_atomic_write value of the remount
options whenever it differs from the mounted one, and without the
option that value is 0, the default. So a remount that does not name
max_atomic_write resets the limit:
# mount -o max_atomic_write=64k /dev/vda /mnt
# findmnt -no OPTIONS /mnt
rw,relatime,inode64,logbufs=8,logbsize=32k,noquota,max_atomic_write=64k
# mount -o remount,noatime /dev/vda /mnt
# findmnt -no OPTIONS /mnt
rw,noatime,inode64,logbufs=8,logbsize=32k,noquota
Start the options of a remount from the value in use. A remount with
max_atomic_write=0 still goes back to the default.
Fixes: 4528b9052731 ("xfs: allow sysadmins to specify a maximum atomic write limit at mount time")
Signed-off-by: Yifan Feng <evanfengff@xxxxxxxxx>
---
Applies on top of the inode32 remount patch, https://lore.kernel.org/r/20261130001917.56901-1-evanfengff@xxxxxxxxx . Tested in QEMU with mount(2), mount(8) and fspick()/fsconfig(). In fstests -g quick plus 178 remount tests, the only failures are the 6 tests that also fail on mainline (XFS_DEBUG, xfsprogs 6.1.0).
Found and written with the help of an AI coding assistant.
fs/xfs/xfs_super.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index bdab50bce3c9..e158adf61cb6 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -2324,6 +2324,10 @@ xfs_init_fs_context(
xfs_has_small_inums(XFS_M(fc->root->d_sb)))
mp->m_features |= XFS_FEAT_SMALL_INUMS;
+ /* A remount without max_atomic_write keeps what is in use. */
+ if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE)
+ mp->m_awu_max_bytes = XFS_M(fc->root->d_sb)->m_awu_max_bytes;
+
xfs_hooks_init(&mp->m_dir_update_hooks);
fc->s_fs_info = mp;
base-commit: 822ba3a89c7896b26e4beb70e2ebffb881924dfe
prerequisite-patch-id: 93a7ebbeb52b34e90e778b08c274509b56e37733
--
2.39.3 (Apple Git-146)