From: Eryu Guan <eguan@redhat.com>
To: Filipe Manana <fdmanana@suse.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] fstests: add btrfs test to stress chunk allocation/removal and fstrim
Date: Tue, 2 Dec 2014 11:06:11 +0800 [thread overview]
Message-ID: <20141202030611.GQ29912@dhcp-13-216.nay.redhat.com> (raw)
In-Reply-To: <1417453889-16317-1-git-send-email-fdmanana@suse.com>
On Mon, Dec 01, 2014 at 05:11:29PM +0000, Filipe Manana wrote:
> Stress btrfs' block group allocation and deallocation while running
> fstrim in parallel. Part of the goal is also to get data block groups
> deallocated so that new metadata block groups, using the same physical
> device space ranges, get allocated while fstrim is running. This caused
> several issues ranging from invalid memory accesses, kernel crashes,
> metadata or data corruption, free space cache inconsistencies, free
> space leaks and memory leaks.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> ---
>
> V2: Addressed Dave's comments.
>
> tests/generic/038 | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++
> tests/generic/038.out | 2 +
> tests/generic/group | 1 +
> 3 files changed, 155 insertions(+)
> create mode 100755 tests/generic/038
> create mode 100644 tests/generic/038.out
>
> diff --git a/tests/generic/038 b/tests/generic/038
> new file mode 100755
> index 0000000..217aa7a
> --- /dev/null
> +++ b/tests/generic/038
> @@ -0,0 +1,152 @@
> +#! /bin/bash
> +# FSQA Test No. 038
> +#
> +# This test was motivated by btrfs issues, but it's generic enough as it
> +# doesn't use any btrfs specific features.
> +#
> +# Stress btrfs' block group allocation and deallocation while running fstrim in
> +# parallel. Part of the goal is also to get data block groups deallocated so
> +# that new metadata block groups, using the same physical device space ranges,
> +# get allocated while fstrim is running. This caused several issues ranging
> +# from invalid memory accesses, kernel crashes, metadata or data corruption,
> +# free space cache inconsistencies, free space leaks and memory leaks.
> +#
> +# These issues were fixed by the following btrfs linux kernel patches:
> +#
> +# Btrfs: fix invalid block group rbtree access after bg is removed
> +# Btrfs: fix crash caused by block group removal
> +# Btrfs: fix freeing used extents after removing empty block group
> +# Btrfs: fix race between fs trimming and block group remove/allocation
> +# Btrfs: fix race between writing free space cache and trimming
> +# Btrfs: make btrfs_abort_transaction consider existence of new block groups
> +# Btrfs: fix memory leak after block remove + trimming
> +# Btrfs: fix extent map leak on chunk allocation failure
> +#
> +# The issues were found on a qemu/kvm guest with 4 virtual CPUs, 4Gb of ram and
> +# scsi-hd devices with discard support enabled (that means hole punching in the
> +# disk's image file is performed by the host).
> +#
> +#-----------------------------------------------------------------------
> +#
> +# Copyright (C) 2014 SUSE Linux Products GmbH. All Rights Reserved.
> +# Author: Filipe Manana <fdmanana@suse.com>
> +#
> +# 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"
> +
> +tmp=/tmp/$$
> +status=1 # failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> + rm -fr $tmp
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# real QA test starts here
> +_need_to_be_root
> +_supported_fs btrfs
This should be "_supported_fs generic"
Thanks,
Eryu
next prev parent reply other threads:[~2014-12-02 3:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-26 15:30 [PATCH] fstests: add btrfs test to stress chunk allocation/removal and fstrim Filipe Manana
2014-12-01 5:25 ` Dave Chinner
2014-12-01 17:11 ` Filipe Manana
2014-12-02 3:06 ` Eryu Guan [this message]
2014-12-02 18:10 ` [PATCH v3] " Filipe Manana
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=20141202030611.GQ29912@dhcp-13-216.nay.redhat.com \
--to=eguan@redhat.com \
--cc=fdmanana@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).