On Sun, 12 Jan 2014 19:35:44 -0600, Eric Sandeen wrote:
On 1/12/14, 7:21 PM, Qu Wenruo wrote:
On fri, 10 Jan 2014 10:15:37 -0600, Eric Sandeen wrote:
On 1/8/14, 12:30 AM, Qu Wenruo wrote:
Test remount btrfs with different pairing options like barrier and no barrier.
It seems that while this tests that the remount succeeds, and that
the option string is present in /proc/mounts, it does not test that
the mount option is actually in effect.
Yes, this is what the new test case is intended to do.
This case was just a test case tests the mount options themselves
to ensure all the pairing mount options works during remounting,
since most pairing options are missing before.
I suppose for many of these options that would be hard to test; for
i.e. acl though it should be trivial.
What do you think, is this enough to ensure that remount handling
is working as expected for all of these options?
In my opinion, this test should just focuses on the remount handling and
the pairing options.
For the detailed function should be examineed in other test cases.
Except those won't test that a remount with those options actually *worked*;
in fact they don't do remount at all.
In other words, all this does is test that an option flag was set or unset in
the superblock, but it doesn't really test whether the option has been
properly set up (or torn down) as a result.
I won't say no to this, but it seems to be of somewhat limited use.
It is true that this test case just tests the flags.
But sometimes it is unsafe to just trigger the flags.
(All right, just the inode_cache flags which is not in the test case)
Though the case is mainly for the flags/mount options examining, but it
able to find some flag triggering defeats if run for enough long time.
Anyway, thanks for your commenting.
Also, most of the pairing options are instructive,
and some may not be in effect before next transaction (for the incomming
so I think is OK for just examining the options and remount handling for now.
Mainly used to test the following comming btrfs kernel commit:(Not in
8dd6d2c btrfs: Add treelog mount option.
f1eccd3 btrfs: Add datasum mount option.
aad3269 btrfs: Add datacow mount option.
22bab74 btrfs: Add acl mount option.
170e45e btrfs: Add noflushoncommit mount option.
ce41bc9 btrfs: Add noenospc_debug mount option.
f3c639b btrfs: Add nodiscard mount option.
962cbee btrfs: Add noautodefrag mount option.
0b4fa2a btrfs: Add "barrier" option to support "-o remount,barrier"
Signed-off-by: Qu Wenruo <quwenruo@xxxxxxxxxxxxxx>
Cc: Eric Sandeen <sandeen@xxxxxxxxxx>
tests/btrfs/025 | 125
tests/btrfs/025.out | 2 +
tests/btrfs/group | 1 +
3 files changed, 128 insertions(+)
create mode 100755 tests/btrfs/025
create mode 100644 tests/btrfs/025.out
diff --git a/tests/btrfs/025 b/tests/btrfs/025
new file mode 100755
@@ -0,0 +1,125 @@
+# Btrfs QA test No. 025
+# Check for paired btrfs mount options
+# Regression test for the following btrfs commits
+# 8dd6d2c btrfs: Add treelog mount option.
+# f1eccd3 btrfs: Add datasum mount option.
+# aad3269 btrfs: Add datacow mount option.
+# 22bab74 btrfs: Add acl mount option.
+# 170e45e btrfs: Add noflushoncommit mount option.
+# ce41bc9 btrfs: Add noenospc_debug mount option.
+# f3c639b btrfs: Add nodiscard mount option.
+# 962cbee btrfs: Add noautodefrag mount option.
+# 0b4fa2a btrfs: Add "barrier" option to support "-o remount,barrier"
+# Copyright (c) 2014 Fujitsu, Inc. All Rights Reserved.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+echo "QA output created by $seq"
+status=0 # success is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+PAIRING_OPTIONS="autodefrag noautodefrag discard nodiscard enospc_debug
noenospc_debug flushoncommit noflushoncommit noacl acl nobarrier barrier nodatacow
datacow nodatasum datasum notreelog treelog space_cache nospace_cache ssd nossd"
+# options that does not show in mount options
+HIDDEN_OPTIONS="noautodefrag nodiscard noenospc_debug noflushoncommit acl barrier
datacow datasum treelog nossd"
+ rm $tmp.running &> /dev/null
+ cd /
+ _scratch_unmount &> /dev/null
+# check the mount option
+ mount_opt=`cat /proc/mounts | grep $mount_point | cut -d\ -f4`
+ if grep $2 $mount_opt; then
+ _fail "test failed: expected $expected_opt option not shown in mount
+# background noise
+ touch $tmp.running
+ while [ -f "$tmp.running" ]; do
+ run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 500 -p 4
+ if [ $? != 0 ]; then
+ _fail "Some error happened executing fsstress when remounting"
+ done &
+ noise_pid=`jobs -p %1`
+ echo $noise_pid > $tmp.running
+ pid=`cat $tmp.running`
+ rm $tmp.running
+ wait $pid
+# get standard environment, filters
+# real QA test starts here
+# no need to use the original mount options
+_scratch_mkfs > /dev/null 2>&1
+for remount_opt in $PAIRING_OPTIONS; do
+ # Sleep for a while ensuring fsstress to do enough stress
+ sleep 1
+ _remount $SCRATCH_MNT $remount_opt
+ if [ $? != 0 ]; then
+ _fail "test failed: $remount_opt not supported"
+ if [[ ! $HIDDEN_OPTIONS =~ $remount ]]; then
+ check_mount_opt $SCRATCH_MNT $remount_opt
+ # Special check for nodatacow
+ if [ $remount_opt == "nodatacow" ]; then
+ check_mount_opt $SCRATCH_MNT nodatasum
+_scratch_unmount || _fail "umount failed"
+echo "Silence is golden"
diff --git a/tests/btrfs/025.out b/tests/btrfs/025.out
new file mode 100644
@@ -0,0 +1,2 @@
+QA output created by 025
+Silence is golden
diff --git a/tests/btrfs/group b/tests/btrfs/group
index 87e7bca..1a4dad8 100644
@@ -27,3 +27,4 @@
024 auto quick
+025 auto quick
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html