Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6581232ybl; Wed, 15 Jan 2020 07:00:52 -0800 (PST) X-Google-Smtp-Source: APXvYqyW1uKp2NGFc1bqe+MaXVEpn4WYlXgUyEbI1fr1IIzDiWtVfo5I/8DODEMaie56RM/H/dZQ X-Received: by 2002:a9d:7999:: with SMTP id h25mr3001668otm.347.1579100452632; Wed, 15 Jan 2020 07:00:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579100452; cv=none; d=google.com; s=arc-20160816; b=lpvTRv2Gt5d5xCAhoADSliGI+I+TR0fFsxqKzrN0Ky7sEHHUp4iEmNi7z61zUZz7Re jd3PMfJ2bgeK5z+m+gw8tNx9v6BZPWhjIhmi6KEgIMj0UdFychXkhGE3MHJI+PXSFQU3 RNf5zhuBb7cd53qIAB3jvqXE43eWJHaFahhx7jgl+/c+on89ZEyy2/X/qt0HRKvUNQ5c fyJNBT+xTf0QdTe6Gj8QOq/OW/a/e4Ma2P+/lhy37xgUbXCCsdKzeUFtVjTcayP2p2kr vU8Cyl9nJDos6RTk6TT/DM7Dg7XnjxmAogJ+gMkGgb4/3B7skRJC3zHxSyxhLYPS/mrh obGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:dkim-signature; bh=IdF3CR86PjR3/icqlGPbxgEESDkiaecNDA80gTmcK8Q=; b=Nr/KyjR9Ie5n+rjTARF+nDs/6kFOD2/tHhJLhJR6vDK1tfVxj2Af1jCtJ7a6BqVSoG iDWK08JwUZCrK4R3MzXMJC54+3cYgecAlwLWZYv0XYrv4C2M4onTX9fqzOLu3Ush3Xkh 6Q9sknntjpxfOU2v7eBfKjohJOtx1v5mbjF+8QH/4zTspMzEswjmI20wUR+nJPra0sO9 YmVxVvdfhhvcG/43/V2fmPlftIzCNmxK0L7H83ErKZtUEKZZkRQ5hSrq4T9aYz5dqiCM RXCVQHyPke4VsdoZQvIy3lCkY+cDWuy9vqboemde4SAw7cJnkJesj+T8cB39Cp9tdcMP BANA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SA5VVeJt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 38si1376684otu.166.2020.01.15.07.00.40; Wed, 15 Jan 2020 07:00:52 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SA5VVeJt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729067AbgAOO7x (ORCPT + 99 others); Wed, 15 Jan 2020 09:59:53 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:35040 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729066AbgAOO7x (ORCPT ); Wed, 15 Jan 2020 09:59:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579100392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IdF3CR86PjR3/icqlGPbxgEESDkiaecNDA80gTmcK8Q=; b=SA5VVeJtfthjY/Ol15ZJib82R0beCMUjLtW7DUI5wtamXkM4mA9BGhaJkORJh+nnFxEyRm mgrYvfspZ8bKu9knr/bVe2mwnmsT/oV1Acz73MmlzT/186Rbm1AFmdMIwyUwkPBWpJmGbC Bhxr+SVu6aumKujPEtSWSg84kianrhw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-227-1uLPKIN8M2aufcEay_IGjQ-1; Wed, 15 Jan 2020 09:59:46 -0500 X-MC-Unique: 1uLPKIN8M2aufcEay_IGjQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 40F5F100E722; Wed, 15 Jan 2020 14:59:42 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-52.rdu2.redhat.com [10.10.120.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86B68675AE; Wed, 15 Jan 2020 14:59:39 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20200115144839.GA30301@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> To: Christoph Hellwig Cc: dhowells@redhat.com, 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? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28754.1579100378.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Wed, 15 Jan 2020 14:59:38 +0000 Message-ID: <28755.1579100378@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Christoph Hellwig wrote: > > Another thread could be writing to the file, and the raciness matters = if I > > want to cache the result of calling SEEK_HOLE - though it might be pos= sible > > just to mask it off. > = > Well, if you have other threads changing the file (writing, punching hol= es, > truncating, etc) you have lost with any interface that isn't an atomic > give me that data or tell me its a hole. And even if that if you allow > threads that aren't part of your fscache implementation to do the > modifications you have lost. If on the other hand they are part of > fscache you should be able to synchronize your threads somehow. Another thread could be writing to the file at the same time, but not in t= he same block. That's managed by netfs, most likely based on the pages and p= age 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 partial= ly written block. [*] For AFS, this is only true of regular files; dirs and symlinks are cac= hed as monoliths and are there entirely or not at all. > > However, SEEK_HOLE doesn't help with the issue of the filesystem 'alte= ring' > > 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 a= n ioctl or something to tell filesystems not to do that with particular file= s. David