From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Theodore Ts'o <tytso@mit.edu>
Subject: Re: mysterious test failure when running xfstests on XFS
Date: Fri, 28 Jun 2019 13:51:54 -0700 [thread overview]
Message-ID: <20190628205154.GF5179@magnolia> (raw)
In-Reply-To: <20190628202117.GA15307@mit.edu>
On Fri, Jun 28, 2019 at 04:21:17PM -0400, Theodore Ts'o wrote:
> When trying to make sure a change to a test works on other file
> systems, I noticed the failure:
>
> xfs_db: error - read only 0 of 32768 bytes
> xfs_db: /tmp/1577.img is invalid (cannot read first 512 bytes)
>
> When I tried tracking down where this failure was coming from, I found
> this:
>
> ++ export 'XFS_IO_PROG=/root/xfstests/bin/xfs_io -i'
> ++ XFS_IO_PROG='/root/xfstests/bin/xfs_io -i'
> ++ '[' xfs == xfs ']'
> ++ touch /tmp/10216.img
> ++ /root/xfstests/bin/mkfs.xfs -d file,name=/tmp/10216.img,size=512m
> ++ /root/xfstests/bin/xfs_db -x -c 'uuid generate' /tmp/10216.img
> ++ grep -q 'invalid UUID\|supported on V5 fs'
> xfs_db: error - read only 0 of 32768 bytes
> xfs_db: /tmp/10216.img is invalid (cannot read first 512 bytes)
> ++ rm -f /tmp/10216.img
>
> Apparently the issue is that the mkfs.xfs is failing, but in init_rc
> we redirect the output to /dev/null:
>
> touch /tmp/$$.img
> $MKFS_XFS_PROG -d file,name=/tmp/$$.img,size=512m >/dev/null 2>&1
> # xfs_db will return 0 even if it can't generate a new uuid, so
> # check the output to make sure if it can change UUID of V5 xfs
> $XFS_DB_PROG -x -c "uuid generate" /tmp/$$.img \
> | grep -q "invalid UUID\|supported on V5 fs" \
> && export XFS_COPY_PROG="$XFS_COPY_PROG -d"
> rm -f /tmp/$$.img
>
> From a test script:
>
> rm -f $IMAGE
> + rm -f /tmp/10216.img
> touch $IMAGE
> + touch /tmp/10216.img
> ./xfsprogs-dev/mkfs/mkfs.xfs -d file,name=$IMAGE,size=512m
> + ./xfsprogs-dev/mkfs/mkfs.xfs -d file,name=/tmp/10216.img,size=512m
> mkfs.xfs: Use the -f option to force overwrite.
Hmmm, mkfs.xfs always requires -f if it was built without blkid since it
then won't have the ability to determine if there's already a filesystem
on the device you're trying to format. Was your xfsprogs was built
without blkid?
$ strings /opt/root/xfstests/bin/mkfs.xfs | grep blkid
$ ldd /opt/root/xfstests/bin/mkfs.xfs
not a dynamic executable
Yep. Rummaging through the xfstests-bld repo... aha!
export LOCAL_CONFIGURE_OPTIONS="$cross --prefix=/ --disable-lib64 --disable-gettext --disable-libicu --disable-blkid" ; \
/me traces it to this commit:
24c24367f36a36 ("build-all: disable blkid when building xfsprogs")
2019-02-19, I guess nobody's updated their xfstests-bld repos since
before then; I certainly hadn't. :)
Hmm... these days xfsprogs really wants to be built with libblkid since
(a) that's the configuration that most distros ship and (b) some of the
online utilities (like xfs_scrub) really /do/ want blkid information to
try to guess the level of parallelism of the device.
What's less clear is how to proceed from here -- should kvm-xfstests
download and build upstream libblkid and then point the xfsprogs build
at it?
I suppose we could change xfstests to detect if mkfs isn't linked
against libblkid and inject a "-f" into XFS_MKFS_PROG, though that could
cause other problems with tests that might not be expecting non-force
mode.
--D
>
> A simple way to reproduce this:
>
> 1) Download the root_fs.img.amd64:
>
> https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/kvm-xfstests/root_fs.img.amd64
>
> 2) Run the command:
>
> kvm-xfstests -I /tmp/root_fs.img.amd64 -c xfs generic/001
>
> 3) Observe the failure:
>
> generic/001 2s ... [16:15:48][ 5.187808] run fstests generic/001 at 2019-06-28 16:15:48
> [16:15:51]- output mismatch (see /results/xfs/results-4k/generic/001.out.bad)
> --- tests/generic/001.out 2019-06-10 00:02:54.000000000 -0400
> +++ /results/xfs/results-4k/generic/001.out.bad 2019-06-28 16:15:51.631596912 -0400
> @@ -1,4 +1,6 @@
> QA output created by 001
> +xfs_db: error - read only 0 of 32768 bytes
> +xfs_db: /tmp/1577.img is invalid (cannot read first 512 bytes)
> cleanup
> setup ....................................
> iter 1 chain ... check ....................................
> ...
> (Run 'diff -u /root/xfstests/tests/generic/001.out /results/xfs/results-4k/generic/001.out.bad' to)
> Ran: generic/001
> Failures: generic/001
>
> I know this used to work, but I'm not sure at what point this started
> failing for me. Is there anything obvious?
>
>
> - Ted
next parent reply other threads:[~2019-06-28 21:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190628202117.GA15307@mit.edu>
2019-06-28 20:51 ` Darrick J. Wong [this message]
2019-06-28 21:35 ` mysterious test failure when running xfstests on XFS Theodore Ts'o
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=20190628205154.GF5179@magnolia \
--to=darrick.wong@oracle.com \
--cc=tytso@mit.edu \
/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.