Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5430636ybl; Tue, 14 Jan 2020 08:49:03 -0800 (PST) X-Google-Smtp-Source: APXvYqw3GuCWGyp8xwqlF0Qi1V95y3HTjKB8FIOXby7o6CFvRwaorud7jXm3ZJjo6nhGUKG8BmTq X-Received: by 2002:aca:cdd6:: with SMTP id d205mr16809893oig.90.1579020542943; Tue, 14 Jan 2020 08:49:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579020542; cv=none; d=google.com; s=arc-20160816; b=puYUc2reeVj5s1MRxzLTD58ObW2TgiM25q9j4JHRClUkxwz8tnKM7RTNLH1WOVT9Az UDHdBfAHlZ2LyESCApf6Yk0or2jnJeHyJQQeuCyLv48sQIoHFZVvAI4ycdCnV2ebv1zu d0otmdfyx9PY4mzq6JjaBlbnvWgawQp+K31HLTId1ahuDzMfqye0zm8YBtZstkBbTRZH ntGtcoepi9kr9gffHQfIrx8ZSdX7lsn9MyLvbXy8WaR6+xpel63er/0LsuuImD3YmE2L wULeXSgDle3bst2WHI3j6/jh61vg7tRmhwteAhNigVx1HiYg1v9U0SOGSzf6I8MUssKw EojA== 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:from:organization :dkim-signature; bh=wa4DvoCfeEWwo/urASd6YVcN7NZPPV/NkQMLP8JZMPc=; b=jnUeqKnFAhouZo4p/QLHiy2Fn/b9ypI6gvWJ14Basq3JlXxqCAKplgE0Lqy5kjCxAN gaEoenOHAOpKn0+OtWvKGiDjD71JQklHD6priXHvynlfWhih9OV2mO0Ua684EaX+hP4J AIQcPAUd+KNqiQf42A3XgAezIFrRJ+zJKX3QNGJcIwseg4dft4D509CuFPHue722njXr 9oF23QKqZM97rEw9J6ODFBG+ZZGaBchkBAvnADPH4z84lDyoP5ZP8YRqbvmbbxB64UP/ zXjL38broHf0Abt7S5qsD3ZDOGBIU4F5YSGbyDdVaInckBmk1lA7pcYh1T4rCrtBwyPZ 53kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="a3/2qNtW"; 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 d1si6735369otf.58.2020.01.14.08.48.52; Tue, 14 Jan 2020 08:49:02 -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="a3/2qNtW"; 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 S1728800AbgANQsm (ORCPT + 99 others); Tue, 14 Jan 2020 11:48:42 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:23636 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728640AbgANQsj (ORCPT ); Tue, 14 Jan 2020 11:48:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579020518; 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; bh=wa4DvoCfeEWwo/urASd6YVcN7NZPPV/NkQMLP8JZMPc=; b=a3/2qNtWS5NkfAPYCrG5beYpHo7nJ4Rt04O2/q8kHNOiZdBHTXTFPkuXyjnCfl2DytpqFQ iCLMOb5vjRn3HtaPkxGon0FLKq9/jpGVd6B3JuT/5/hc5UEzXvhmlSDSRB/2eXmOiOBtVC w5k25P/1KTBHhZVD2SaFQafi6fWIiuo= 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-137-qff8BlnUO7GRh5at_9TLdg-1; Tue, 14 Jan 2020 11:48:34 -0500 X-MC-Unique: qff8BlnUO7GRh5at_9TLdg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7B70891FE18; Tue, 14 Jan 2020 16:48:32 +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 E8C9C60BF1; Tue, 14 Jan 2020 16:48:29 +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 To: linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, hch@lst.de, tytso@mit.edu, adilger.kernel@dilger.ca, darrick.wong@oracle.com, clm@fb.com, josef@toxicpanda.com, dsterba@suse.com cc: dhowells@redhat.com, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Problems with determining data presence by examining extents? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4466.1579020509.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Tue, 14 Jan 2020 16:48:29 +0000 Message-ID: <4467.1579020509@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Again with regard to my rewrite of fscache and cachefiles: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log= /?h=3Dfscache-iter I've got rid of my use of bmap()! Hooray! However, I'm informed that I can't trust the extent map of a backing file = to tell me accurately whether content exists in a file because: (a) Not-quite-contiguous extents may be joined by insertion of blocks of zeros by the filesystem optimising itself. This would give me a fals= e positive when trying to detect the presence of data. (b) Blocks of zeros that I write into the file may get punched out by filesystem optimisation since a read back would be expected to read z= eros there anyway, provided it's below the EOF. This would give me a fals= e negative. Is there some setting I can use to prevent these scenarios on a file - or = can one be added? Without being able to trust the filesystem to tell me accurately what I've written into it, I have to use some other mechanism. Currently, I've swit= ched to storing a map in an xattr with 1 bit per 256k block, but that gets hard= to use if the file grows particularly large and also has integrity consequenc= es - though those are hopefully limited as I'm now using DIO to store data into= the cache. If it helps, I'm downloading data in aligned 256k blocks and storing data = in those same aligned 256k blocks, so if that makes it easier... David