From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31A67C3F2C6 for ; Tue, 3 Mar 2020 17:30:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0408720836 for ; Tue, 3 Mar 2020 17:30:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730375AbgCCRas (ORCPT ); Tue, 3 Mar 2020 12:30:48 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:43333 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726899AbgCCRas (ORCPT ); Tue, 3 Mar 2020 12:30:48 -0500 Received: from callcc.thunk.org (guestnat-104-133-0-105.corp.google.com [104.133.0.105] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 023HUcGc014351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 3 Mar 2020 12:30:42 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 7BAD442045B; Tue, 3 Mar 2020 12:30:38 -0500 (EST) Date: Tue, 3 Mar 2020 12:30:38 -0500 From: "Theodore Y. Ts'o" To: Bo Branten Cc: linux-ext4@vger.kernel.org Subject: Re: A question on umounting without flushing journal Message-ID: <20200303173038.GC61444@mit.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Mar 03, 2020 at 11:26:13AM +0100, Bo Branten wrote: > > now I have another question on how to test the ext4 driver we implement for > another os: At mount time the driver should check the journal and use jbd2 > to replay if there is anything left in it and I would like to ask if there > is any other methods to do an unclean umount in linux besides pressing > reset? I would like to leave a lot of records in the journal that our driver > can try to process? The standard way to do this in xfstests is using the dm-flakey device-mapper device. We set it up so that all reads and writes are passed through, and then we start some workload such as fsstress, and then we reconfigure dm-flakey to drop 100% of all write requests to the underlying block device. We then kill the workload, and unmount the file system, and then we reset the dm-flakey device to pass through 100% of all writes. This simulates quite accurately what the block device would look like after a sudden power failure, but it doesn't require a power-fail rack (without shortening the lives of the equipment; dropping power tends to put a lot stress on the hardware). Cheers, - Ted