From: Yifan Feng <evanfengff@gmail.com>
To: Carlos Maiolino <cem@kernel.org>
Cc: Ian Kent <raven@themaw.net>,
Christian Brauner <brauner@kernel.org>,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Yifan Feng <evanfengff@gmail.com>
Subject: [PATCH] xfs: don't drop inode32 on a remount without inode32 or inode64
Date: Sun, 29 Nov 2026 16:19:17 -0800 [thread overview]
Message-ID: <20261130001917.56901-1-evanfengff@gmail.com> (raw)
xfs_fs_reconfigure() compares the mounted state with the options of
the remount, and those start out as inode64. So a remount that names
neither inode32 nor inode64 switches an inode32 mount to inode64, and
new inodes get numbers above 32 bits:
# mount -o inode32 /dev/vda /mnt
# mount -o remount,noatime /dev/vda /mnt
# grep /mnt /proc/mounts
/dev/vda /mnt xfs rw,noatime,inode64,logbufs=8,logbsize=32k,noquota 0 0
mount(8) hides this when it is given the mount point only, because it
then passes the current options again. Before the conversion to the
mount API the setting changed only when one of the two options was
given.
Start the options of a remount from the setting in use.
Fixes: 73e5fff98b64 ("xfs: switch to use the new mount-api")
Signed-off-by: Yifan Feng <evanfengff@gmail.com>
---
Tested in QEMU on a 4 TB filesystem with mount(2) and with fspick()/fsconfig(). fstests -g quick plus 178 tests that remount give the same results with and without the patch (XFS_DEBUG, xfsprogs 6.1.0).
Found and written with the help of an AI coding assistant.
fs/xfs/xfs_super.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 2f6999b6947e..bdab50bce3c9 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -2319,6 +2319,11 @@ xfs_init_fs_context(
mp->m_allocsize_log = 16; /* 64k */
mp->m_read_bounce = XFS_READ_BOUNCE_LAZY;
+ /* A remount without inode32 or inode64 keeps what is in use. */
+ if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE &&
+ xfs_has_small_inums(XFS_M(fc->root->d_sb)))
+ mp->m_features |= XFS_FEAT_SMALL_INUMS;
+
xfs_hooks_init(&mp->m_dir_update_hooks);
fc->s_fs_info = mp;
base-commit: 822ba3a89c7896b26e4beb70e2ebffb881924dfe
--
2.39.3 (Apple Git-146)
reply other threads:[~2026-11-30 0:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261130001917.56901-1-evanfengff@gmail.com \
--to=evanfengff@gmail.com \
--cc=brauner@kernel.org \
--cc=cem@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=raven@themaw.net \
/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
all inboxes | Powered by JetHome®