All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yifan Feng <evanfengff@gmail.com>
To: fstests@vger.kernel.org
Cc: Zorro Lang <zlang@kernel.org>, Christoph Hellwig <hch@lst.de>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Carlos Maiolino <cem@kernel.org>,
	linux-xfs@vger.kernel.org, Yifan Feng <evanfengff@gmail.com>
Subject: [PATCH] xfs: test that a remount keeps inode32
Date: Wed,  2 Dec 2026 13:08:37 -0800	[thread overview]
Message-ID: <20261202210837.24902-1-evanfengff@gmail.com> (raw)

A remount that named neither inode32 nor inode64 switched an inode32
mount to inode64.  Check the option that /proc/mounts shows after a
remount with an unrelated option and after a read-only/read-write
cycle, and check that remount,inode64 and remount,inode32 still switch
the mode.

Signed-off-by: Yifan Feng <evanfengff@gmail.com>
---
Fails on 7.4-rc4 ("remount,noatime: inode64") and passes with the kernel patch, https://lore.kernel.org/r/20261130001917.56901-1-evanfengff@gmail.com . Asked for by Christoph Hellwig in the review of that patch.
Found and written with the help of an AI coding assistant.

 tests/xfs/842     | 44 ++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/842.out |  7 +++++++
 2 files changed, 51 insertions(+)
 create mode 100755 tests/xfs/842
 create mode 100644 tests/xfs/842.out

diff --git a/tests/xfs/842 b/tests/xfs/842
new file mode 100755
index 0000000..fd0365c
--- /dev/null
+++ b/tests/xfs/842
@@ -0,0 +1,44 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2026 Yifan Feng.  All Rights Reserved.
+#
+# FS QA Test 842
+#
+# Check that a remount which names neither inode32 nor inode64 keeps the
+# inode allocation mode of the mount.
+#
+. ./common/preamble
+_begin_fstest auto quick mount remount
+
+_fixed_by_kernel_commit xxxxxxxxxxxx \
+	"xfs: don't drop inode32 on a remount without inode32 or inode64"
+
+_require_scratch
+_exclude_scratch_mount_option "inode32" "inode64"
+
+# Remount with one option, then print which of inode32 and inode64
+# /proc/mounts shows.
+remount_and_show()
+{
+	local mode
+
+	_scratch_remount $1
+	mode=$(_fs_options $SCRATCH_DEV | grep -oE 'inode(32|64)')
+	echo "remount,$1: $mode"
+}
+
+_scratch_mkfs >> $seqres.full 2>&1
+_scratch_mount -o inode32
+
+# A remount with an unrelated option keeps inode32.
+remount_and_show noatime
+remount_and_show ro
+remount_and_show rw
+
+# A remount that names inode64 switches to it, and inode64 is kept as well.
+remount_and_show inode64
+remount_and_show relatime
+remount_and_show inode32
+
+# success, all done
+_exit 0
diff --git a/tests/xfs/842.out b/tests/xfs/842.out
new file mode 100644
index 0000000..34e40a1
--- /dev/null
+++ b/tests/xfs/842.out
@@ -0,0 +1,7 @@
+QA output created by 842
+remount,noatime: inode32
+remount,ro: inode32
+remount,rw: inode32
+remount,inode64: inode64
+remount,relatime: inode64
+remount,inode32: inode32
-- 
2.39.3 (Apple Git-146)


                 reply	other threads:[~2026-12-02 21:08 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=20261202210837.24902-1-evanfengff@gmail.com \
    --to=evanfengff@gmail.com \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.