Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4546170pxf; Tue, 30 Mar 2021 10:18:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqbexwqrcW7STDyjsisGjtP+RdHFOEwjrBvQS5VwhdrSoMS4nvIG9sE2KnNtNbURwWbVFF X-Received: by 2002:a17:906:27c7:: with SMTP id k7mr34799171ejc.13.1617124716596; Tue, 30 Mar 2021 10:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617124716; cv=none; d=google.com; s=arc-20160816; b=l9KcCrI/rwgYzFDk8Obh/xA2jS91vsXloZ+oAFqxJsSmG9ouMUmc8kSqYMA3cm+vgt u+FXqgEWC61TvdikhvxU0pnkXJmrFHf8v3vLiG9IoRxGoDiLJ1nXSMBjEzswdvl0yPw2 AGnEYduVvmuqHEswVoqXUPtAms1xmRJ7ZeoAE+SSw46aw9iCXMoFzfHI4wIAhpYvXd5M ubKhZkprUpWUI/Sk9E+vI25by7rpSMdoM/uNDua2/JkwgPg14BEIFQTezLjpxLA9tK1U pJmeGcacvAw/Ch361YutoiB5KtK4VyPFvmB3jiMxrjkkN3+D9wnK0ftfIWIoYkBgWdFr 3cvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=HWuix4O70PExJPGCF56ytTTj2fPCsBUIF2WENJ//xX8=; b=qXDU1FHfd9DkTtZNet8rpxWqIeUldWxx4FvVfyWP6pYMUS7xYcU/l3iDBJWS9ZislN czceKBYQjssmd3lOVBlOQ0DCJ6xcpq9IuHQVc2SNJd1/DhTFQJSuXTiGNI68Dy12px2S uLFS+FV6uBil5BZLSiH10SANx7Fkpt1PF0owE7p2UYyJPZFsUERFMvYgt2bTHsjghDhg 9F6XoOUlFJTH7XCPggIeUz8hBbMs+F9xDYXCIn/nOip7C5b5HsZfeV2tDYQSQvjoONgK aXTOEYcrWQsbvn3kgX63xtk/PkMJ0drDyLLoSCTmLNg1NjHjg7WdOsgduE6aATbYsHUK O0Hw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i17si19264707ejo.365.2021.03.30.10.18.10; Tue, 30 Mar 2021 10:18:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232311AbhC3RP2 (ORCPT + 99 others); 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