All of lore.kernel.org
 help / color / mirror / Atom feed
From: kaixuxia <xiakaixu1987@gmail.com>
To: fstests@vger.kernel.org
Cc: linux-xfs@vger.kernel.org, guaneryu@gmail.com,
	bfoster@redhat.com, newtongao@tencent.com,
	jasperwang@tencent.com
Subject: [PATCH v2 4/4] xfs: test the deadlock between the AGI and AGF with RENAME_WHITEOUT
Date: Sat, 26 Oct 2019 19:18:38 +0800	[thread overview]
Message-ID: <a6dc5bd7c0f50840dfd034cd2d0e6931eeb9658a.1572057903.git.kaixuxia@tencent.com> (raw)
In-Reply-To: <cover.1572057903.git.kaixuxia@tencent.com>
In-Reply-To: <cover.1572057903.git.kaixuxia@tencent.com>

There is ABBA deadlock bug between the AGI and AGF when performing
rename() with RENAME_WHITEOUT flag, and add this testcase to make
sure the rename() call works well.

Signed-off-by: kaixuxia <kaixuxia@tencent.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
---
 tests/generic/579     | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/579.out |  2 ++
 tests/generic/group   |  1 +
 3 files changed, 59 insertions(+)
 create mode 100755 tests/generic/579
 create mode 100644 tests/generic/579.out

diff --git a/tests/generic/579 b/tests/generic/579
new file mode 100755
index 0000000..95727f3
--- /dev/null
+++ b/tests/generic/579
@@ -0,0 +1,56 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2019 Tencent.  All Rights Reserved.
+#
+# FS QA Test No. 579
+#
+# Regression test for:
+#    bc56ad8c74b8: ("xfs: Fix deadlock between AGI and AGF with RENAME_WHITEOUT")
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1        # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+        cd /
+        rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/renameat2
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_os Linux
+_supported_fs generic
+_require_scratch
+_require_renameat2 whiteout
+
+_scratch_mkfs > $seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mount >> $seqres.full 2>&1
+
+# start a create and rename(rename_whiteout) workload. These processes
+# occur simultaneously may cause the deadlock between AGI and AGF with
+# RENAME_WHITEOUT.
+$FSSTRESS_PROG -z -n 150 -p 100 \
+		-f mknod=5 \
+		-f rwhiteout=5 \
+		-d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1
+
+echo Silence is golden
+
+# Failure comes in the form of a deadlock.
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/579.out b/tests/generic/579.out
new file mode 100644
index 0000000..06f4633
--- /dev/null
+++ b/tests/generic/579.out
@@ -0,0 +1,2 @@
+QA output created by 579
+Silence is golden
diff --git a/tests/generic/group b/tests/generic/group
index 6f9c4e1..21870d2 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -581,3 +581,4 @@
 576 auto quick verity encrypt
 577 auto quick verity
 578 auto quick rw clone
+579 auto rename
-- 
1.8.3.1


      parent reply	other threads:[~2019-10-26 11:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-26 11:18 [PATCH v2 0/4] xfstests: add deadlock between the AGI and AGF with RENAME_WHITEOUT test kaixuxia
2019-10-26 11:18 ` [PATCH v2 1/4] fsstress: show the real file id and parid in rename_f() kaixuxia
2019-10-26 11:18 ` [PATCH v2 2/4] fsstress: add NOREPLACE and WHITEOUT renameat2 support kaixuxia
2019-10-29 13:39   ` Brian Foster
2019-10-26 11:18 ` [PATCH v2 3/4] fsstress: add EXCHANGE " kaixuxia
2019-10-29 13:40   ` Brian Foster
2019-10-30  3:17     ` kaixuxia
2019-10-30 12:40       ` Brian Foster
2019-10-31  1:51         ` kaixuxia
2019-10-26 11:18 ` kaixuxia [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6dc5bd7c0f50840dfd034cd2d0e6931eeb9658a.1572057903.git.kaixuxia@tencent.com \
    --to=xiakaixu1987@gmail.com \
    --cc=bfoster@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=jasperwang@tencent.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=newtongao@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.