All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
To: <fstests@vger.kernel.org>
Cc: <linux-btrfs@vger.kernel.org>,
	Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Subject: [PATCH] fstest: btrfs: add a test for quota number when deleting a subvol.
Date: Tue, 3 Mar 2015 19:13:30 +0800	[thread overview]
Message-ID: <1425381210-13661-1-git-send-email-yangds.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <54EEB798.1070105@cn.fujitsu.com>

This regression is introduced by two commits:

e339a6b0 (Btrfs: __btrfs_mod_ref should always use no_quota)
1152651a (btrfs: qgroup: account shared subtrees during snapshot delete)

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
 tests/btrfs/084     | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/084.out |  3 ++
 tests/btrfs/group   |  1 +
 3 files changed, 88 insertions(+)
 create mode 100755 tests/btrfs/084
 create mode 100644 tests/btrfs/084.out

diff --git a/tests/btrfs/084 b/tests/btrfs/084
new file mode 100755
index 0000000..7b7c7ac
--- /dev/null
+++ b/tests/btrfs/084
@@ -0,0 +1,84 @@
+#! /bin/bash
+# FS QA Test No. 084
+#
+# This is a case for the regression introduced by
+#
+# e339a6b0 (Btrfs: __btrfs_mod_ref should always use no_quota)
+# 1152651a (btrfs: qgroup: account shared subtrees during snapshot delete)
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2015 Fujitsu.  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
+#-----------------------------------------------------------------------
+#
+
+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
+
+# real QA test starts here
+_need_to_be_root
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+
+_scratch_mount
+
+$XFS_IO_PROG -f -d -c "pwrite 0 8K" $SCRATCH_MNT/foo 2>&1 > /dev/null
+
+_run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap
+
+_run_btrfs_util_prog quota enable $SCRATCH_MNT
+_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
+
+units=`_btrfs_qgroup_units`
+orig_result=`$BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | $AWK_PROG 'NR==NF {print $3}'`
+
+_run_btrfs_util_prog subvolume delete $SCRATCH_MNT/snap
+
+_run_btrfs_util_prog filesystem sync $SCRATCH_MNT
+
+timeout=100
+# There is a background thread doing the clean work
+for ((i=0; i<$timeout; i++))
+do
+	result=`$BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | $AWK_PROG 'NR==NF {print $3}'`
+	if (($orig_result != $result))
+	then
+		break
+	fi
+	sleep 1
+done
+
+$BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | $AWK_PROG '/[0-9]/ {print $2" "$3}'
+
+# success, all done
+status=0
+exit
diff --git a/tests/btrfs/084.out b/tests/btrfs/084.out
new file mode 100644
index 0000000..7bf6dbf
--- /dev/null
+++ b/tests/btrfs/084.out
@@ -0,0 +1,3 @@
+QA output created by 084
+24576 24576
+0 0
diff --git a/tests/btrfs/group b/tests/btrfs/group
index fe82a9c..1be7392 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -86,3 +86,4 @@
 081 auto quick clone
 082 auto quick remount
 083 auto quick send
+084 qgroup
-- 
1.8.4.2


WARNING: multiple messages have this Message-ID (diff)
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
To: fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org, Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Subject: [PATCH] fstest: btrfs: add a test for quota number when deleting a subvol.
Date: Tue, 3 Mar 2015 19:13:30 +0800	[thread overview]
Message-ID: <1425381210-13661-1-git-send-email-yangds.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <54EEB798.1070105@cn.fujitsu.com>

This regression is introduced by two commits:

e339a6b0 (Btrfs: __btrfs_mod_ref should always use no_quota)
1152651a (btrfs: qgroup: account shared subtrees during snapshot delete)

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
 tests/btrfs/084     | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/084.out |  3 ++
 tests/btrfs/group   |  1 +
 3 files changed, 88 insertions(+)
 create mode 100755 tests/btrfs/084
 create mode 100644 tests/btrfs/084.out

diff --git a/tests/btrfs/084 b/tests/btrfs/084
new file mode 100755
index 0000000..7b7c7ac
--- /dev/null
+++ b/tests/btrfs/084
@@ -0,0 +1,84 @@
+#! /bin/bash
+# FS QA Test No. 084
+#
+# This is a case for the regression introduced by
+#
+# e339a6b0 (Btrfs: __btrfs_mod_ref should always use no_quota)
+# 1152651a (btrfs: qgroup: account shared subtrees during snapshot delete)
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2015 Fujitsu.  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
+#-----------------------------------------------------------------------
+#
+
+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
+
+# real QA test starts here
+_need_to_be_root
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+
+_scratch_mount
+
+$XFS_IO_PROG -f -d -c "pwrite 0 8K" $SCRATCH_MNT/foo 2>&1 > /dev/null
+
+_run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap
+
+_run_btrfs_util_prog quota enable $SCRATCH_MNT
+_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
+
+units=`_btrfs_qgroup_units`
+orig_result=`$BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | $AWK_PROG 'NR==NF {print $3}'`
+
+_run_btrfs_util_prog subvolume delete $SCRATCH_MNT/snap
+
+_run_btrfs_util_prog filesystem sync $SCRATCH_MNT
+
+timeout=100
+# There is a background thread doing the clean work
+for ((i=0; i<$timeout; i++))
+do
+	result=`$BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | $AWK_PROG 'NR==NF {print $3}'`
+	if (($orig_result != $result))
+	then
+		break
+	fi
+	sleep 1
+done
+
+$BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | $AWK_PROG '/[0-9]/ {print $2" "$3}'
+
+# success, all done
+status=0
+exit
diff --git a/tests/btrfs/084.out b/tests/btrfs/084.out
new file mode 100644
index 0000000..7bf6dbf
--- /dev/null
+++ b/tests/btrfs/084.out
@@ -0,0 +1,3 @@
+QA output created by 084
+24576 24576
+0 0
diff --git a/tests/btrfs/group b/tests/btrfs/group
index fe82a9c..1be7392 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -86,3 +86,4 @@
 081 auto quick clone
 082 auto quick remount
 083 auto quick send
+084 qgroup
-- 
1.8.4.2


  reply	other threads:[~2015-03-03 11:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10 10:24 [PATCH 0/3] Btrfs: qgroup: part-3: bug fixes for deleting subvolume Dongsheng Yang
2015-02-10 10:24 ` [PATCH 1/3] btrfs: qgroup: return EINVAL if level of parent is not higher than child's Dongsheng Yang
2015-02-10 10:24 ` [PATCH 2/3] btrfs: qgroup: allow to remove qgroup which has parent but no child Dongsheng Yang
2015-02-10 10:24 ` [PATCH 3/3] btrfs: qgroup: fix a wrong parameter of no_quota Dongsheng Yang
2015-02-10 11:24   ` Filipe David Manana
2015-02-11  2:51     ` Dongsheng Yang
2015-02-13  9:38   ` Dongsheng Yang
2015-02-26  6:05     ` Dongsheng Yang
2015-03-03 11:13       ` Dongsheng Yang [this message]
2015-03-03 11:13         ` [PATCH] fstest: btrfs: add a test for quota number when deleting a subvol Dongsheng Yang
2015-03-06  5:06         ` Eryu Guan
2015-03-16  5:06           ` Dongsheng Yang
2015-03-16  5:06             ` Dongsheng Yang
2015-03-16  5:33             ` Eryu Guan
2015-03-16  5:47               ` Dongsheng Yang
2015-03-16  5:47                 ` Dongsheng Yang
2015-03-16  5:58             ` [PATCH v2] " Dongsheng Yang
2015-03-16  5:58               ` Dongsheng Yang
2015-03-03 11:18       ` [PATCH 3/3] btrfs: qgroup: fix a wrong parameter of no_quota Dongsheng Yang
2015-03-03 14:00         ` Josef Bacik
2015-03-03 20:20           ` Mark Fasheh
2015-03-16  4:59             ` Dongsheng Yang
2015-03-17 15:27               ` Dongsheng Yang

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=1425381210-13661-1-git-send-email-yangds.fnst@cn.fujitsu.com \
    --to=yangds.fnst@cn.fujitsu.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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.