public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [problem] xfstests generic/311 unreliable...
Date: Tue, 7 May 2013 17:11:02 +1000	[thread overview]
Message-ID: <20130507071102.GA24635@dastard> (raw)

Hi Josef,

I was just looking at a generic/311, and I think there's something
fundamentally wrong with the way it is checking the scratch device.

You reported it was failing for internal test 19 on XFS, but I'm
seeing is fail after the first test or 2, randomly. It has never
made it past test 3. So I had a little bit of a closer look at it's
structure. Essentially it is doing this (and the contents seen by
each step:

scratch dev + mkfs
	+-------------------------------+
overlay dm-flakey
	D-------------------------------D
mount/write/kill/unmount dm-flakey
	Dx-x-x-x-x-x-x------------------D

All good up to here. Now, you can _check_scratch_fs which sees:

scratch dev + check
	+-------------------------------+

i.e. it's not seeing all the changes written to dm-flakey and so
xfs-check it seeing corruption.

After I realised this was stacking block devices and checking the
underlying block device, the cause was pretty obvious: scratch-dev
and dm-flakey have different address spaces, so changes written
throughone address space will not be seen through the other address
space if there is stale cached data in the original address space.

And that's exactly what is happening. This patch:

--- a/tests/generic/311
+++ b/tests/generic/311
@@ -79,6 +79,7 @@ _mount_flakey()
 _unmount_flakey()
 {
        $UMOUNT_PROG $SCRATCH_MNT
+       echo 3 > /proc/sys/vm/drop_caches
 }
 
 _load_flakey_table()

Makes the problem go away for xfs_check. But really, I don't like
the assumption that the test is built on - that writes through one
block device are visible through another. It's just asking for weird
problems.

Is there some way that you can restructure this test so it doesn't
have this problem (e.g. do everything on dm-flakey)?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2013-05-07  7:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-07  7:11 Dave Chinner [this message]
2013-05-07  7:37 ` [problem] xfstests generic/311 unreliable Dave Chinner
2013-05-07 13:28   ` [BULK] " Josef Bacik
2013-05-07 14:10   ` Josef Bacik

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=20130507071102.GA24635@dastard \
    --to=david@fromorbit.com \
    --cc=xfs@oss.sgi.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