xfstests btrfs/012: test balance while creating and deleting subvolumes
PATCH 1/1 xfstests btrfs/012: test balance while creating and deleting subvolumes
Do subvolume create/delete in loop at back ground and do filesystem balance at the same time could trigger
kernel BUG at fs/btrfs/relocation.c:2255!
on 3.12-rc4 kernel.
Signed-off-by Eryu Guan <[email protected]>
--- tests/btrfs/012 | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/012.out | 11 ++++++++ tests/btrfs/group | 1 + 3 files changed, 86 insertions(+) create mode 100755 tests/btrfs/012 create mode 100644 tests/btrfs/012.out
tests/btrfs/012 new file +74 -0
@@ -0,0 +1,74 @@ +#! /bin/bash +# FS QA Test No. btrfs/012 +# +# Test btrfs balance while creating and deleting subvolumes +# +# On buggy kernel this could trigger: +# kernel BUG at fs/btrfs/relocation.c:2255! +# +#----------------------------------------------------------------------- +# Copyright (c) 2013 Red Hat, 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 +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here +_supported_fs btrfs +_supported_os Linux +_require_scratch +_require_scratch_dev_pool + +subvolume=subvol_$seq +rm -f $seqres.full + +subvolume_create_delete() +{ + while true; do + $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/$subvolume >/dev/null + $BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/$subvolume >/dev/null + done +} + +_scratch_pool_mkfs >> $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +subvolume_create_delete & + +for i in `seq 1 10`;do + $BTRFS_UTIL_PROG filesystem balance start $SCRATCH_MNT >>$seqres.full 2>&1 + echo "Done balance loop $i" +done +kill $! +wait + +# No crash, test passed +status=0 +exit
tests/btrfs/012.out new file +11 -0
@@ -0,0 +1,11 @@ +QA output created by 012 +Done balance loop 1 +Done balance loop 2 +Done balance loop 3 +Done balance loop 4 +Done balance loop 5 +Done balance loop 6 +Done balance loop 7 +Done balance loop 8 +Done balance loop 9 +Done balance loop 10
tests/btrfs/group +1 -0
@@ -14,3 +14,4 @@ 009 auto quick 010 auto quick 011 auto +012 auto quick
Signature · 6 lines
1.8.3.1 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
On 10/10/2013 12:52 PM, Eryu Guan wrote:
Gui Hecheng has send a patch for this before:
[PATCH V2] xfstest: an regression test for btrfs balance
https://patchwork.kernel.org/patch/3006261/
Thanks,
Wang
Quoted 122 lines
Do subvolume create/delete in loop at back ground and do filesystem balance at the same time could trigger
kernel BUG at
fs/btrfs/relocation.c:2255!on 3.12-rc4 kernel.
Signed-off-by Eryu Guan <[email protected]>--- tests/btrfs/012 | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/012.out | 11 ++++++++ tests/btrfs/group | 1 + 3 files changed, 86 insertions(+)create mode 100755 tests/btrfs/012
create mode 100644 tests/btrfs/012.outtests/btrfs/012 new file +74
-0@@ -0,0 +1,74 @@ +#! /bin/bash +# FS QA Test No. btrfs/012 +# +# Test btrfs balance while creating and deleting subvolumes +# +# On buggy kernel this could trigger: +# kernel BUG at fs/btrfs/relocation.c:2255! +# +#----------------------------------------------------------------------- +# Copyright (c) 2013 Red Hat, 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 +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here +_supported_fs btrfs +_supported_os Linux +_require_scratch +_require_scratch_dev_pool + +subvolume=subvol_$seq +rm -f $seqres.full + +subvolume_create_delete() +{ + while true; do + $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/$subvolume >/dev/null + $BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/$subvolume >/dev/null + done +} + +_scratch_pool_mkfs >> $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +subvolume_create_delete & + +for i in `seq 1 10`;do + $BTRFS_UTIL_PROG filesystem balance start $SCRATCH_MNT >>$seqres.full 2>&1 + echo "Done balance loop $i" +done +kill $! +wait + +# No crash, test passed +status=0 +exittests/btrfs/012.out new file +11
-0@@ -0,0 +1,11 @@ +QA output created by 012 +Done balance loop 1 +Done balance loop 2 +Done balance loop 3 +Done balance loop 4 +Done balance loop 5 +Done balance loop 6 +Done balance loop 7 +Done balance loop 8 +Done balance loop 9 +Done balance loop 10tests/btrfs/group +1
-0@@ -14,3 +14,4 @@ 009 auto quick 010 auto quick 011 auto +012 auto quick