From: Dave Chinner <david@fromorbit.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH] fstest: btrfs/006: Add extra check on return value and 'fi show' by device
Date: Wed, 21 Jan 2015 15:03:15 +1100 [thread overview]
Message-ID: <20150121040315.GC16510@dastard> (raw)
In-Reply-To: <1421373430-21915-1-git-send-email-quwenruo@cn.fujitsu.com>
On Fri, Jan 16, 2015 at 09:57:10AM +0800, Qu Wenruo wrote:
> Reported in Red Hat BZ#1181627, 'btrfs fi show' on unmounted device will
> return 1 even no error happens.
Please describe the bug in the commit message, don't make me have to
go look at some web page to work out what you are trying to fix.
> Introduced by: commit 2513077f
> btrfs-progs: fix device missing of btrfs fi show with seed devices
>
> Patch fixing it:
> https://patchwork.kernel.org/patch/5626001/
> btrfs-progs: Fix wrong return value when executing 'fi show' on
> umounted device.
What btrfs progs commit introduced and fixed is not actually
relevant to fstests. If I have to go read other stuff to understand
the change you are making, then the description needs more detail
and less external references....
> Reported-by: Vratislav Podzimek <vpodzime@redhat.com>
> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
> ---
> tests/btrfs/006 | 51 ++++++++++++++++++++++++++++++++++++++++++++-------
> tests/btrfs/006.out | 10 ++++++++++
> 2 files changed, 54 insertions(+), 7 deletions(-)
>
> diff --git a/tests/btrfs/006 b/tests/btrfs/006
> index 715fd80..2d8c1c0 100755
> --- a/tests/btrfs/006
> +++ b/tests/btrfs/006
> @@ -62,33 +62,70 @@ _scratch_pool_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
>
> # These have to be done unmounted...?
> echo "== Set filesystem label to $LABEL"
> -$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
> +$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL || \
> + _fail "set lable failed"
Apart from the typo, why not _run_btrfs_util_prog?
However, this will make the test fail on older btrfs progs
installations that we previously passing the test just fine, right?
IOWs, if you want to test that `btrfs fi show` always returns the
correct value, don't add that checking to an existing test: write a
new test that tests the validity of the return value....
> echo "== Get filesystem label"
> -$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
> +$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV || \
> + _fail "get lable failed"
> +
> +echo "== Show filesystem by device(offline)"
> +$BTRFS_UTIL_PROG filesystem show $FIRST_POOL_DEV | \
> + _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
> +[ ${PIPESTATUS[0]} -ne 0 ] && \
> + _fail "show filesystem by device(offline) return value wrong"
That's a new function being tested. Again, this belongs in a new
test, not an existing regression test....
FWIW, Now that I've seen it used a couple of times, I don't really
like the mess that checking errors via PIPESTATUS results in,
especially as
_run_btrfs_util_prog filesystem show $FIRST_POOL_DEV | \
_filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
Gives *exactly* the same failure detection....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2015-01-21 4:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-16 1:57 [PATCH] fstest: btrfs/006: Add extra check on return value and 'fi show' by device Qu Wenruo
2015-01-21 4:03 ` Dave Chinner [this message]
2015-01-21 4:19 ` Qu Wenruo
2015-01-21 4:54 ` Dave Chinner
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=20150121040315.GC16510@dastard \
--to=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo@cn.fujitsu.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 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).