Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6485278ybl; Wed, 15 Jan 2020 05:31:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzqXm0lSFs4eF8ZDDy5r+Dws/iZYPhhjstRJ6jDgdWqSNlKL2vEDVyArPV3rsay4kdxOyEq X-Received: by 2002:a05:6808:3d0:: with SMTP id o16mr21022435oie.79.1579095097204; Wed, 15 Jan 2020 05:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579095097; cv=none; d=google.com; s=arc-20160816; b=K4KZ14KP/wjOBj1T4t5VYd77yl4unPAC4kuKyPkTo8t4uhC4DZNnfSdIZZO1MIEDOD L4VwIZ91PnIUZmTB9LtHSDVnxRW9zIkP8LnqyrpL7x8Na5b1mq9ErDotruVIkUa/L9F5 eNHpBXjxNyN2vq39ZAW0TfdpKRKnKSnuR214uOvHssCQAClo45EhAsuZ3P3FL8Go0XXC 5b528am4goyMgGIvoYiFJpBK55asS1xq0UA1qcamg2tcsIGjbnnP1RkcHDvG80f5u7IT Q908WqlGK5wwn8muKWkirNabluXAaokGE9aw3RZqqN6+GGoX/xcQfjW8kEK1wMQ8RnD6 wIDA== 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=9tNFQOdYoBHM3stHB8GBVWA90SZ2WOXaly6Vtz2hHJ8=; b=lFVrbaVAnaskbNDSm/+s5R0HHaHDxFi5hTMLZLDKQBZsCiQGLmsw4+sMTr1cVsCLf0 TM1Gw27Uwo1uNaHNgu+lC2ATXDzaE3OBBop0+BE2kUj44PNxJdDhdK1gbpGD65WOLHrb Bmt3p0aBLEEUdDiA1X4L3i03hJL3Er0WSJaIAOQGugFRCA3AFOIhB2V9eANE7jO5zUYU DbV0ijejnfsm3IA7BG5TGbEpru8P0twIoboDu5+Eljq2XXGE9pR4ZOGQn5OZ9D/PqSUh TDfY725dB9ZE0ULqSip2UJ5q6g8gN6F/A0zVx8E43+9AojyC53ub2/Dr/BluUYzdXIRD n4Xw== 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 u12si10594141otq.51.2020.01.15.05.31.25; Wed, 15 Jan 2020 05:31:37 -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 S1729021AbgAONbH (ORCPT + 99 others); Wed, 15 Jan 2020 08:31:07 -0500 Received: from verein.lst.de ([213.95.11.211]:50875 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729057AbgAONbG (ORCPT ); Wed, 15 Jan 2020 08:31:06 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 4D61968BE1; Wed, 15 Jan 2020 14:31:02 +0100 (CET) Date: Wed, 15 Jan 2020 14:31:01 +0100 From: Christoph Hellwig To: Qu Wenruo Cc: Andreas Dilger , David Howells , linux-fsdevel , Al Viro , Christoph Hellwig , "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: <20200115133101.GA28583@lst.de> References: <4467.1579020509@warthog.procyon.org.uk> <00fc7691-77d5-5947-5493-5c97f262da81@gmx.com> <27181AE2-C63F-4932-A022-8B0563C72539@dilger.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 09:10:44PM +0800, Qu Wenruo wrote: > > That allows userspace to distinguish fe_physical addresses that may be > > on different devices. This isn't in the kernel yet, since it is mostly > > useful only for Btrfs and nobody has implemented it there. I can give > > you details if working on this for Btrfs is of interest to you. > > IMHO it's not good enough. > > The concern is, one extent can exist on multiple devices (mirrors for > RAID1/RAID10/RAID1C2/RAID1C3, or stripes for RAID5/6). > I didn't see how it can be easily implemented even with extra fields. > > And even we implement it, it can be too complex or bug prune to fill > per-device info. It's also completely bogus for the use cases to start with. fiemap is a debug tool reporting the file system layout. Using it for anything related to actual data storage and data integrity is a receipe for disaster. As said the right thing for the use case would be something like the NFS READ_PLUS operation. If we can't get that easily it can be emulated using lseek SEEK_DATA / SEEK_HOLE assuming no other thread could be writing to the file, or the raciness doesn't matter.