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=-3.8 required=3.0 tests=BAYES_00, 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 E1C2FC433E1 for ; Tue, 30 Mar 2021 17:15:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B6EE8619D0 for ; Tue, 30 Mar 2021 17:15:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232367AbhC3RP2 (ORCPT ); Tue, 30 Mar 2021 13:15:28 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:42803 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231808AbhC3RPN (ORCPT ); Tue, 30 Mar 2021 13:15:13 -0400 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 12UHF8Rl016621 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Mar 2021 13:15:08 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 3B01A15C39CD; Tue, 30 Mar 2021 13:15:08 -0400 (EDT) Date: Tue, 30 Mar 2021 13:15:08 -0400 From: "Theodore Ts'o" To: "Darrick J. Wong" Cc: harshad shirwadkar , Leah Rumancik , Ext4 Developers List Subject: Re: [PATCH 2/2] ext4: add ioctl EXT4_FLUSH_JOURNAL Message-ID: References: <20210325181220.1118705-1-leah.rumancik@gmail.com> <20210325181220.1118705-2-leah.rumancik@gmail.com> <20210326012146.GB22091@magnolia> <20210330163223.GD22091@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210330163223.GD22091@magnolia> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Mar 30, 2021 at 09:32:23AM -0700, Darrick J. Wong wrote: > Why not make discarding the journal part of FITRIM then? Unfortunately, the fstrim_range structure doesn't have a place for a flags field, and FITRIM works by specifying a range of LBA's: struct fstrim_range { __u64 start; __u64 len; __u64 minlen; }; I suppose we could do something where some combination of start/len means "also checkpoint and discard the journal", but that seems rather kludgy. > It occurred to me overnight that another way to look at this ioctl > proposal is that it checkpoints the filesystem and has a flag to discard > the journal blocks too. Given that we're now only two days away from > my traditional bootfs[1] drum-banging day, and there's real user > demand[2] for bootloaders to be able to force a journal checkpoint, How about if we have an ioctl which is "checkpoint journal", which can be file system independent (e.g., defined in include/uapi/linux/fs.h) which takes a u32 flags field, where we define a flag bit to mean "also discard the unused part of the journal after the checkpoint"? It seems that would also solve your bootfs() use case. - Ted