public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: Eryu Guan <eguan@redhat.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] Fstest: btrfs/151: test if device delete ends up with losing raid profile
Date: Mon, 16 Oct 2017 10:59:04 -0700	[thread overview]
Message-ID: <20171016175904.GB2516@localhost.localdomain> (raw)
In-Reply-To: <20171014053317.GU10593@eguan.usersys.redhat.com>

On Sat, Oct 14, 2017 at 01:33:17PM +0800, Eryu Guan wrote:
> On Fri, Oct 13, 2017 at 01:40:05PM -0600, Liu Bo wrote:
> > Currently running 'btrfs device delete' can end up with losing data
> > raid profile (if any), this test is to reproduce the problem.
> > 
> > The fix is
> >      "Btrfs: avoid losing data raid profile when deleting a device"
> > 
> > Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> > ---
> >  tests/btrfs/151     | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  tests/btrfs/151.out |  2 ++
> >  tests/btrfs/group   |  1 +
> >  3 files changed, 76 insertions(+)
> >  create mode 100755 tests/btrfs/151
> >  create mode 100644 tests/btrfs/151.out
> > 
> > diff --git a/tests/btrfs/151 b/tests/btrfs/151
> > new file mode 100755
> > index 0000000..1866cb6
> > --- /dev/null
> > +++ b/tests/btrfs/151
> > @@ -0,0 +1,73 @@
> > +#! /bin/bash
> > +# FS QA Test 151
> > +#
> > +# Test if it's losing data chunk's raid profile after 'btrfs device
> > +# remove'.
> > +#
> > +# The fix is
> > +#	Btrfs: avoid losing data raid profile when deleting a device
> > +#
> > +#-----------------------------------------------------------------------
> > +# Copyright (c) 2017 Oracle.  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
> > +
> > +# remove previous $seqres.full before test
> > +rm -f $seqres.full
> > +
> > +# real QA test starts here
> > +
> > +# Modify as appropriate.
> > +_supported_fs btrfs
> > +_supported_os Linux
> > +_require_scratch
> > +_require_scratch_dev_pool 3
> > +
> > +# create raid1 for data
> > +_scratch_pool_mkfs "-d raid1 -b 1G" >> $seqres.full 2>&1
> > +
> > +# we need an empty data chunk, so nospace_cache is required.
> > +_scratch_mount -onospace_cache
> > +
> > +# if data chunk is empty, 'btrfs device remove' can change raid1 to
> > +# single.
> > +$BTRFS_UTIL_PROG device delete 2 $SCRATCH_MNT >> $seqres.full
> > +
> > +df_ret=`$BTRFS_UTIL_PROG filesystem df $SCRATCH_MNT`
> > +echo $df_ret | $AWK_PROG -F ':' '/Data,/ {print $1}'
> 
> Forgot to commit the changes before sending? It looks like the same as v1.
>

Sorry for the trouble, I've sent a 'PATCH v2 RESEND' for review.

Thanks,

-liubo

  reply	other threads:[~2017-10-16 17:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 17:39 [PATCH] Fstest: btrfs/151: test if device delete ends up with losing raid profile Liu Bo
2017-10-12  7:06 ` Eryu Guan
2017-10-13 18:08   ` Liu Bo
2017-10-16  6:57     ` Nikolay Borisov
2017-10-16 17:46       ` Liu Bo
2017-10-13 19:40 ` [PATCH v2] " Liu Bo
2017-10-14  5:33   ` Eryu Guan
2017-10-16 17:59     ` Liu Bo [this message]
2017-10-16 16:51 ` [PATCH v2 RESEND] " Liu Bo

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=20171016175904.GB2516@localhost.localdomain \
    --to=bo.li.liu@oracle.com \
    --cc=eguan@redhat.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