From: Amir Goldstein Subject: Re: [RFC PATCH] fstests: Check if a fs can survive random (emulated) power loss Date: Mon, 26 Feb 2018 10:15:57 +0200 Message-ID: References: <20180226073111.3066-1-wqu@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: fstests , Linux Btrfs , linux-xfs , Ext4 , Josef Bacik To: Qu Wenruo Return-path: In-Reply-To: <20180226073111.3066-1-wqu@suse.com> Sender: linux-btrfs-owner@vger.kernel.org List-Id: linux-ext4.vger.kernel.org On Mon, Feb 26, 2018 at 9:31 AM, Qu Wenruo 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. > Come on... dm-flakey is so 2016 You should take Josef's fsstress+log-writes test and bring it to fstests: https://github.com/josefbacik/log-writes By doing that you will gain two very important features from the test: 1. Problems will be discovered much faster, because the test can run fsck after every single block write has been replayed instead of just at random times like in your test 2. Absolute guaranty to reproducing the problem by replaying the write log. Even though your fsstress could use a pre-defined random seed to results will be far from reproduciable, because of process and IO scheduling differences between subsequent test runs. When you catch an inconsistency with log-writes test, you can send the write-log recording to the maintainer to analyze the problem, even if it is a hard problem to hit. I used that useful technique for ext4,btrfs,xfs when ran tests with generic/455 and found problems. Cheers, Amir.