Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp164364ybh; Fri, 6 Mar 2020 18:33:01 -0800 (PST) X-Google-Smtp-Source: ADFU+vtUQKoW6tHucedTrNjMkhNmq2XZVCgcsAmObRgypJY5/mBE2nHipwe1KKsVzvoT6mpLEiia X-Received: by 2002:aca:d50f:: with SMTP id m15mr4784686oig.33.1583548381079; Fri, 06 Mar 2020 18:33:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583548381; cv=none; d=google.com; s=arc-20160816; b=mgNTdjVmvLS/nIzDAzniyEOWfLysw6HpDO1iGLW7oF9qsJbVGeLSBLq7QJM/uQHM0S Xhwjz/7R2+rxPQJHRkPeASW4IapDHK1BhFjQ3ZwUUDLyybEvJXKOTck5JbE3gvuqI/V0 Nzu/D5/Y1X4MZq4jEKcneZPXcGxYEyt4ILXacRkK8FKwryeqqGFPNnaxkJO60gY33neo Fvc3PM0ccrTjyCSVVkhGkwceVnX8Wuc6/c1z86gzlOU9fEkf2ebTRn4wRvhJwptVYJYb 51w6hb7Bm7oZtTiE7N0ymSP4TQfBdASCD5U1NB5TGjAdWPjgnAPvdbDwr4PL5QK7cZHA un9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=CnAZG1FjjmUdHEpT/cU72W/ByS1j3Ym8RSGmKvKvQtc=; b=RMd2QvUt4UCbE2okj3+LprkivdoP1kTxf7PRYodL1cQmt9dEG6iADZVPJ3eo8NBswM V8z1fC38B1xAGRW71mAlE2F4QxcFRriCGtw0ougulKLOgJE8Ryw6E2hFURijAMrCBZJF PLriw5Sea8MqWsJvEZLMUmoEdgNYw5IxDdaTgI5WEwooloAFua3ywZQTy8Fynrjt8NQA AwmdxF1jgQOOUiGczESYNq3Im8YVIJ8NDMasSw6VeO0GeT9w1XTyUO9VsQcHgimHT+8y tN1RmGpbBAzIvGhrCCCoMocMyeb0PbRY/fyOPXlkwmz9jOPKXhxWZ1a/LTOh/pWa50Br HBiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si2481686otp.119.2020.03.06.18.32.40; Fri, 06 Mar 2020 18:33:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726271AbgCGCch (ORCPT + 99 others); Fri, 6 Mar 2020 21:32:37 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:34521 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726237AbgCGCch (ORCPT ); Fri, 6 Mar 2020 21:32:37 -0500 Received: from callcc.thunk.org (pool-72-93-95-157.bstnma.fios.verizon.net [72.93.95.157]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 0272WCYq023096 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 6 Mar 2020 21:32:12 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 3485142045B; Fri, 6 Mar 2020 21:32:12 -0500 (EST) Date: Fri, 6 Mar 2020 21:32:12 -0500 From: "Theodore Y. Ts'o" To: "Darrick J. Wong" Cc: Jan Kara , Ritesh Harjani , linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca, linux-fsdevel@vger.kernel.org, hch@infradead.org, cmaiolino@redhat.com, david@fromorbit.com Subject: Re: [PATCHv5 3/6] ext4: Move ext4 bmap to use iomap infrastructure. Message-ID: <20200307023212.GA7845@mit.edu> References: <8bbd53bd719d5ccfecafcce93f2bf1d7955a44af.1582880246.git.riteshh@linux.ibm.com> <20200228152524.GE8036@magnolia> <20200302085840.A41E3A4053@d06av23.portsmouth.uk.ibm.com> <20200303154709.GB8037@magnolia> <20200304124211.GC21048@quack2.suse.cz> <20200304153745.GG8036@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200304153745.GG8036@magnolia> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Mar 04, 2020 at 07:37:45AM -0800, Darrick J. Wong wrote: > > > This makes me wonder if you still need the filemap_write_and_wait in the > > > JDATA case because otherwise the journal flush won't have the effect of > > > writing all the dirty pagecache back to the filesystem? OTOH I suppose > > > the implicit write-and-wait call after we clear JDATA will not be > > > writing to the journal. > > > > > > Even more weirdly, the FIEMAP code doesn't drop JDATA at all...? > > > > Yeah, it should do that but that's only performance optimization so that we > > bother with journal flushing only when someone uses block mapping call on > > a file with journalled dirty data. So you can hardly notice the bug by > > testing... > > If we ever decide to deprecate FIBMAP officially and push bootloaders to > use FIEMAP, then we'll have to emulate all the flushing behaviors. But > that's something for a separate patch. This is really only needed for LILO, since I believe this is the only bootloader which uses the output of FIBMAP to determine the block number where it will attempt to ***write*** into a data block of a mounted file system. I seem to recall either Dave or Christoph ranting at one point that any program which attempted to write into a mounted file system using the output of FIEMAP was insane, and we should not be encouraging that kind of wacko behavior. :-) What most bootloaders want is simply the accurate list of block locations so they can write that into the stage 1 bootloader so it can read the stage 2 bootloader from the disk. The reason why we have the JDATA hack in the bmap code is because LILO will get the block location, and then try to write config information into that block. So we are trying to prevent LILO's write of the boot command line from possibly getting rewritten after a journal replay. (Of course, no distribution installer would do something as rude as to just forcibly rebooting the system without a clean unmount, so this would *never* be a problem, RIGHT? :-) In any case, I'd much rather try to get LILO fixed to do something sane, rather that move that heavy-ugly JDATA code into FIEMAP, where it might get triggered unnecessarily by 99.9% of the users who are doing something not-insane. - Ted