aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasayoshi Mizuma <m.mizuma@jp.fujitsu.com>2022-02-16 09:55:20 -0500
committerEryu Guan <guaneryu@gmail.com>2022-04-10 18:40:50 +0800
commit4837b6aff4d3e466d3dfc3120fe4568ecf717180 (patch)
treec1a84c94058b323df97e5712092930fff564bf1d
parent034e1a796f4b7bebd845ba66bf362d75ca02ef59 (diff)
downloadxfstests-dev-4837b6aff4d3e466d3dfc3120fe4568ecf717180.tar.gz
xfs: test xfsdump with bind-mounted filesystem
commit 25195eb ("xfsdump: handle bind mount target") introduced a bug of xfsdump which doesn't store the files to the dump file correctly when the root inode number is changed. The commit 25195eb is reverted, and commit 0717c1c ("xfsdump: intercept bind mount targets") which is in xfsdump v3.1.10 fixes the bug to reject the filesystem if it's bind-mounted. Test that xfsdump can reject the bind-mounted filesystem. Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rwxr-xr-xtests/xfs/54447
-rw-r--r--tests/xfs/544.out2
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/xfs/544 b/tests/xfs/544
new file mode 100755
index 0000000000..c7251fc315
--- /dev/null
+++ b/tests/xfs/544
@@ -0,0 +1,47 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2022 Fujitsu Limited. All Rights Reserved.
+#
+# FS QA Test 544
+#
+# Regression test for commit:
+# 0717c1c ("xfsdump: intercept bind mount targets")
+
+. ./common/preamble
+_begin_fstest auto quick dump
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -r -f $tmp.*
+ $UMOUNT_PROG $TEST_DIR/dest.$seq 2> /dev/null
+ rmdir $TEST_DIR/src.$seq 2> /dev/null
+ rmdir $TEST_DIR/dest.$seq 2> /dev/null
+}
+
+# Import common functions.
+. ./common/filter
+. ./common/dump
+
+# real QA test starts here
+
+_supported_fs xfs
+
+# Setup
+rm -rf $TEST_DIR/src.$seq
+rm -rf $TEST_DIR/dest.$seq
+mkdir $TEST_DIR/src.$seq
+mkdir $TEST_DIR/dest.$seq
+
+# Test
+echo "*** dump with bind-mounted test ***" >> $seqres.full
+
+$MOUNT_PROG --bind $TEST_DIR/src.$seq $TEST_DIR/dest.$seq || _fail "Bind mount failed"
+
+$XFSDUMP_PROG -L session -M test -f $tmp.dump $TEST_DIR/dest.$seq \
+ >> $seqres.full 2>&1 && echo "dump with bind-mounted should be failed, but passed."
+
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/xfs/544.out b/tests/xfs/544.out
new file mode 100644
index 0000000000..fc7ebff305
--- /dev/null
+++ b/tests/xfs/544.out
@@ -0,0 +1,2 @@
+QA output created by 544
+Silence is golden