[PATCH v1 3/3] xfs: Add a testcase to check remount with noattr2 on a v5 xfs

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



This testcase reproduces the following bug:
Bug:
mount -o remount,noattr2 <device> <mount_point> succeeds
unexpectedly on a v5 xfs when CONFIG_XFS_SUPPORT_V4 is set.

Ideally the above mount command should always fail with a v5 xfs
filesystem irrespective of whether CONFIG_XFS_SUPPORT_V4 is set
or not.

Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@xxxxxxxxx>
---
 tests/xfs/634     | 35 +++++++++++++++++++++++++++++++++++
 tests/xfs/634.out |  3 +++
 2 files changed, 38 insertions(+)
 create mode 100755 tests/xfs/634
 create mode 100644 tests/xfs/634.out

diff --git a/tests/xfs/634 b/tests/xfs/634
new file mode 100755
index 00000000..dc153047
--- /dev/null
+++ b/tests/xfs/634
@@ -0,0 +1,35 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2025 Nirjhar Roy (IBM) <nirjhar.roy.lists@xxxxxxxxx>.  All Rights Reserved.
+#
+# FS QA Test 634
+#
+# This test checks that mounting and remounting a v5 xfs filesystem with
+# noattr2 fails. Currently, this test will pass with CONFIG_XFS_SUPPORT_V4=n but
+# with CONFIG_XFS_SUPPORT_V4=y, this will fail i.e, mount -o remount,noattr2
+# command succeeds incorrectly.
+#
+. ./common/preamble
+. ./common/filter
+
+_begin_fstest auto quick mount
+_require_scratch
+# Import common functions.
+
+_fixed_by_kernel_commit xxxx \
+	""
+_require_scratch_xfs_v5
+_scratch_mkfs -m crc=1 > $seqres.full 2>&1 ||
+	_notrun "need an xfs v5 filesystem"
+_scratch_mount "-o noattr2" |& grep -iq "fail" && \
+	echo "mount failed successfully"
+_scratch_mount
+! _scratch_remount noattr2 >> $seqres.full 2>&1 && \
+	echo "remount failed successfully"
+_scratch_unmount
+
+# success, all done
+status=0
+exit
+status=0
+exit
diff --git a/tests/xfs/634.out b/tests/xfs/634.out
new file mode 100644
index 00000000..8a98c05c
--- /dev/null
+++ b/tests/xfs/634.out
@@ -0,0 +1,3 @@
+QA output created by 634
+mount failed successfully
+remount failed successfully
-- 
2.34.1





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux