]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
btrfs: test cycle mounting a filesystem right after enabling simple quotas v2025.01.12
authorFilipe Manana <fdmanana@suse.com>
Tue, 7 Jan 2025 16:02:11 +0000 (16:02 +0000)
committerZorro Lang <zlang@kernel.org>
Sun, 12 Jan 2025 04:20:18 +0000 (12:20 +0800)
Test that if we enable simple quotas on a filesystem and unmount it right
after without doing any other changes to the filesystem, we are able to
mount again the filesystem.

This is a regression test for the following kernel commit:

  f2363e6fcc79 ("btrfs: fix transaction atomicity bug when enabling simple quotas")

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
tests/btrfs/328 [new file with mode: 0755]
tests/btrfs/328.out [new file with mode: 0644]

diff --git a/tests/btrfs/328 b/tests/btrfs/328
new file mode 100755 (executable)
index 0000000..8e56c4d
--- /dev/null
@@ -0,0 +1,31 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2025 SUSE Linux Products GmbH. All Rights Reserved.
+#
+# FS QA Test 328
+#
+# Test that if we enable simple quotas on a filesystem and unmount it right
+# after without doing any other changes to the filesystem, we are able to mount
+# again the filesystem.
+#
+. ./common/preamble
+_begin_fstest auto quick qgroup
+
+_fixed_by_kernel_commit f2363e6fcc79 \
+       "btrfs: fix transaction atomicity bug when enabling simple quotas"
+
+_require_scratch_enable_simple_quota
+
+_scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mount
+
+$BTRFS_UTIL_PROG quota enable --simple $SCRATCH_MNT
+
+# Without doing any other change to the filesystem, unmount it and mount it
+# again. This should work - we had a bug where it crashed due to an assertion
+# failure (when kernel config has CONFIG_BTRFS_ASSERT=y).
+_scratch_cycle_mount
+
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/btrfs/328.out b/tests/btrfs/328.out
new file mode 100644 (file)
index 0000000..67faba8
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 328
+Silence is golden