[PATCH] btrfs: test cycle mounting a filesystem right after enabling simple quotas

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



From: Filipe Manana <fdmanana@xxxxxxxx>

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@xxxxxxxx>
---
 tests/btrfs/328     | 31 +++++++++++++++++++++++++++++++
 tests/btrfs/328.out |  2 ++
 2 files changed, 33 insertions(+)
 create mode 100755 tests/btrfs/328
 create mode 100644 tests/btrfs/328.out

diff --git a/tests/btrfs/328 b/tests/btrfs/328
new file mode 100755
index 00000000..8e56c4d6
--- /dev/null
+++ b/tests/btrfs/328
@@ -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
index 00000000..67faba8f
--- /dev/null
+++ b/tests/btrfs/328.out
@@ -0,0 +1,2 @@
+QA output created by 328
+Silence is golden
-- 
2.45.2





[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