From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9409EC33CB1 for ; Wed, 15 Jan 2020 13:31:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68C532084D for ; Wed, 15 Jan 2020 13:31:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729076AbgAONbH (ORCPT ); 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-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@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.