public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Qu Wenruo <wqu@suse.com>, fstests <fstests@vger.kernel.org>,
	dm-devel@redhat.com
Subject: Re: [RFC PATCH] fstests: Check if a fs can survive random (emulated) power loss
Date: Thu, 1 Mar 2018 19:48:59 +0800	[thread overview]
Message-ID: <0abab816-a2a4-82bf-e43e-37535f1228a8@gmx.com> (raw)
In-Reply-To: <CAOQ4uxhy7iU71dB9aTFx+aeMowNoi0QMVT2GDUM81R_CTZxxsA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2842 bytes --]



On 2018年03月01日 19:15, Amir Goldstein wrote:
> On Thu, Mar 1, 2018 at 11:25 AM, Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
>>
>>
>> On 2018年03月01日 16:39, Amir Goldstein wrote:
>>> On Thu, Mar 1, 2018 at 7:38 AM, Qu Wenruo <wqu@suse.com> wrote:
>>>> This test case is originally designed to expose unexpected corruption
>>>> for btrfs, where there are several reports about btrfs serious metadata
>>>> corruption after power loss.
>>>>
>>>> The test case itself will trigger heavy fsstress for the fs, and use
>>>> dm-flakey to emulate power loss by dropping all later writes.
>>>
>>> So you are re-posting the test with dm-flakey or converting it to
>>> dm-log-writes??
>>
>> Working on the scripts to allow us to do --find and then replay.
>>
>> Since for xfs and ext4, their fsck would report false alerts just for
>> dirty journal.
>>
>> I'm adding new macro to locate next flush and replay to it, then mount
>> it RW before we call fsck.
>>
>> Or do we have options for those fscks to skip dirty journal?
>>
> 
> No, you are much better off doing mount/umount before fsck.
> Even though e2fsck can replay a journal, it does that much slower
> then the kernel does.
> 
> But why do you need to teach --find to find next flush?
> You could use a helper script to run every fua with --fsck --check fua.
> Granted, for fstests context, I agree that --find next fua may look
> nicer, so I have no objection to this implementation.

The point is, in my opinion fua is not the worst case we need to test.
Only flush could leads us to the worst case we really need to test.

In btrfs' case, if we finished flush, but without fua, we have a super
block points to all old trees, but all new trees are already written to
disk.

In that flush entry, we could reach to the worst case scenario to verify
all btrfs tricks are working all together to get a completely sane btrfs
(even all data should be correct).

This should also apply to journal based filesystems (if I understand the
journal thing correctly), even when all journals written but superblock
not updated, we should be completely fine.
(Although for journal, we may need to reach fua entry instead of flush?)

And the other reason why we need to find next flush/fua manually is,
mount will write new data, and we need to replay all the sequence until
next flush/fua.


And finally the reason about why need manually mount is, we need to
workaround e2fsck/xfs_repair, so that they won't report dirty journal as
error. If we have extra options to disable such behavior, I'm completely
OK with current --check flush/fua --fsck method.
(BTW, for my btrfs testing, --check flush --fsck is completely good
enough, to exposed possible free space cache related problems)

Thanks,
Qu

> 
> Thanks,
> Amir.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 520 bytes --]

  reply	other threads:[~2018-03-01 11:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01  5:38 [RFC PATCH] fstests: Check if a fs can survive random (emulated) power loss Qu Wenruo
2018-03-01  5:38 ` [PATCH 1/2] fstests: log-writes: Add support to output human readable flags Qu Wenruo
2018-03-01  8:37   ` Amir Goldstein
2018-03-01  5:38 ` [PATCH 2/2] fstests: log-writes: Add support for METADATA flag Qu Wenruo
2018-03-01  8:39 ` [RFC PATCH] fstests: Check if a fs can survive random (emulated) power loss Amir Goldstein
2018-03-01  9:25   ` Qu Wenruo
2018-03-01 11:15     ` Amir Goldstein
2018-03-01 11:48       ` Qu Wenruo [this message]
2018-03-01 12:50         ` Amir Goldstein
2018-03-01  9:27   ` Qu Wenruo
  -- strict thread matches above, loose matches on Subject: below --
2018-02-26  7:31 Qu Wenruo
2018-02-26  8:15 ` Amir Goldstein
2018-02-26  8:20   ` Qu Wenruo
2018-02-26  8:33     ` Amir Goldstein
2018-02-26  8:41       ` Qu Wenruo
2018-02-26  8:45         ` Amir Goldstein
2018-02-26  8:50           ` Qu Wenruo

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=0abab816-a2a4-82bf-e43e-37535f1228a8@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=amir73il@gmail.com \
    --cc=dm-devel@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=wqu@suse.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