Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7592972ybl; Thu, 16 Jan 2020 02:15:21 -0800 (PST) X-Google-Smtp-Source: APXvYqz1BabkYOH6LXldI/7x4gCXeAqsOa5E4rlcN7Ind7C6UJ3mXB2wH+zHaZyNjXyC0b3OyBaq X-Received: by 2002:a9d:774e:: with SMTP id t14mr1320264otl.358.1579169720948; Thu, 16 Jan 2020 02:15:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579169720; cv=none; d=google.com; s=arc-20160816; b=qHzDRflaIHPMYv+kKQCYC3E8EdB+cXdKAbNEO38JsTzpprflN1fwsJRKXD4MDQw74J zmyZQ7feTwuW+eyD6HYrzn8JwySyG4/Y36miFeWu6PLboWLGGCR+udCDDte/Y9LCCIrF 6h0WGI18pRa4kCCh4qtxTTbI8b/v2moE9qXDS4aw0+GIv6NDGI7YS09edLt4Bh+Xu3EZ /j+jLcYmKThwwbx6aknJIhuCB3AQueCnlX2W2nYAm9ydZQo4Fkdte64XPmH1l0E1IGA4 mWwTloCzgzoS8WvctceLwv+ktSbv6+EYQT8ybv2L9YPi3uhKmD1joansDWVQVecUhHEV o9KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kj62iR0AKdfNj9FahA2RwY8uivZBLxtDUNzwUnNNV6c=; b=rWDyJnbdtx8AgSiA/ZSdG+9ulq70ZqI5MjVeuhIBtCxUa6qGuwype9k97BbSPg0WuD xSiG8qS3MF8/MLwjNx5I5jTKXA3PxWjldDQyhQwO6LBf0o4WkYTDkdYRz2Kb2rRNSoaT o2sxntW+FZg+O9v2Op8E72g8ZLql3IcIbTlfMmKlWfVJwTf6qhx9C79KoUV8xbuh9wvG INsqPiG+lAdZLQ0n1tLdAHoPBRaQ+dd7dohniqZHuW660qJSv7/FvvKAZU9qkqcrED9A 4S9KDawdJIvvy0RzUN9MI0Fc5VWlJ9VTcXWzVjZpG+z0gqa/GwIk4AvLaqkisJT625bA Zk3g== 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 w15si12430714otm.263.2020.01.16.02.15.06; Thu, 16 Jan 2020 02:15:20 -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 S1730990AbgAPKNt (ORCPT + 99 others); Thu, 16 Jan 2020 05:13:49 -0500 Received: from verein.lst.de ([213.95.11.211]:55181 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730518AbgAPKNs (ORCPT ); Thu, 16 Jan 2020 05:13:48 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id BCCC468B20; Thu, 16 Jan 2020 11:13:44 +0100 (CET) Date: Thu, 16 Jan 2020 11:13:44 +0100 From: Christoph Hellwig To: David Howells Cc: Christoph Hellwig , Qu Wenruo , Andreas Dilger , linux-fsdevel , Al Viro , "Theodore Y. Ts'o" , "Darrick J. Wong" , Chris Mason , Josef Bacik , David Sterba , linux-ext4 , linux-xfs , linux-btrfs , Linux Kernel Mailing List Subject: Re: Problems with determining data presence by examining extents? Message-ID: <20200116101344.GA16435@lst.de> References: <20200115144839.GA30301@lst.de> <20200115133101.GA28583@lst.de> <4467.1579020509@warthog.procyon.org.uk> <00fc7691-77d5-5947-5493-5c97f262da81@gmx.com> <27181AE2-C63F-4932-A022-8B0563C72539@dilger.ca> <26093.1579098922@warthog.procyon.org.uk> <28755.1579100378@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <28755.1579100378@warthog.procyon.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Jan 15, 2020 at 02:59:38PM +0000, David Howells wrote: > Another thread could be writing to the file at the same time, but not in the > same block. That's managed by netfs, most likely based on the pages and page > flags attached to the netfs inode being cached in this particular file[*]. > > What I was more thinking of is that SEEK_HOLE might run past the block of > interest and into a block that's currently being written and see a partially > written block. But that's not a problem given that you know where to search. > > [*] For AFS, this is only true of regular files; dirs and symlinks are cached > as monoliths and are there entirely or not at all. > > > > However, SEEK_HOLE doesn't help with the issue of the filesystem 'altering' > > > the content of the file by adding or removing blocks of zeros. > > > > As does any other method. If you need that fine grained control you > > need to track the information yourself. > > So, basically, I can't. Okay. I was hoping it might be possible to add an > ioctl or something to tell filesystems not to do that with particular files. File systems usually pad zeroes where they have to, typically for sub-blocksize writes. Disabling this would break data integrity.