Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp603432ybf; Wed, 26 Feb 2020 19:25:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzmnsKwKxai9Ik4ADwYsbJD8EkNKKkfLbE0SsZ+wqC1/wOYrg6AZQIEKP1PZgDNWAX0kshE X-Received: by 2002:a9d:4c8e:: with SMTP id m14mr1558145otf.245.1582773910634; Wed, 26 Feb 2020 19:25:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582773910; cv=none; d=google.com; s=arc-20160816; b=yhVYAXZBfdvstwnGnMD0dlSx74stlMcRdUUynXFKcrfZn1xNNg7Hd/pGoMIVpOO8vz 72n2yd5Zva+69PNyjMSWd4bT60Qy685CQJNrkTS/q3aaCPLkpmGOajMcbw1hiScM0pGw Fsz70RI0AXV1n7LUUTaDYsmofOeEdP9qDNfqazaMQz1Q8t55lZ7a4VUoPiqCiXh/OJhe RaT+X7PX71wUJBPTIeNXibscvMuvCUko9rXEQ3vWiNRKLX04IZLgJfRl885dYDImDfnM 80UXXXduhjSjJsjYvkZaYuZp3Rp7J4SkzU/SvTy9iIxb15IlNuuKlUWpumALxmFsKL12 E6Lg== 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=Mw44+OWYdIadXEJyk4ZDCRCBK/k1KgZKdB/7sfAsSlc=; b=p7Ib5+0aVkpxp8CZ3IjpwKYZCMlWTw8o3UqCjYNTQSSsFKGHlKUYICKpK1smmoG0/Y t/9hOm8/c/uCcb5UP1RyrIr+vk3Cs4kR/zfLoCyswVxv9O/MFk9DnPlIYkmvNmjjuDxD 2NPW4ZCNk8Wi/UB2Qz5amF9/LiDNm4pCD8lyWSfHnvA51a+GymC/72nKBpCX+FusNvG5 2j4pXV0BFHjTlHpU8xY9ZSNVd2PkWqBm5LIXPD7TUmnNUAwCNOGmDepAtJOyktRijzyZ kl9VgGBes1E3EXks4RsUTLO0t1Wk2WincfQgj66FlVXa9pw5PRDRRxTpWuukkjEgpKUm nozw== 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 t7si547070oij.175.2020.02.26.19.24.50; Wed, 26 Feb 2020 19:25:10 -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 S1728238AbgB0DYt (ORCPT + 99 others); Wed, 26 Feb 2020 22:24:49 -0500 Received: from mail105.syd.optusnet.com.au ([211.29.132.249]:54469 "EHLO mail105.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728216AbgB0DYt (ORCPT ); Wed, 26 Feb 2020 22:24:49 -0500 Received: from dread.disaster.area (pa49-195-202-68.pa.nsw.optusnet.com.au [49.195.202.68]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id D45133A315B; Thu, 27 Feb 2020 14:24:44 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1j79n1-00069d-U2; Thu, 27 Feb 2020 14:24:43 +1100 Date: Thu, 27 Feb 2020 14:24:43 +1100 From: Dave Chinner To: Jan Kara Cc: "Darrick J. Wong" , Matthew Wilcox , Ritesh Harjani , tytso@mit.edu, linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca, linux-fsdevel@vger.kernel.org, hch@infradead.org, cmaiolino@redhat.com Subject: Re: [PATCHv3 6/6] Documentation: Correct the description of FIEMAP_EXTENT_LAST Message-ID: <20200227032443.GI10737@dread.disaster.area> References: <279638c6939b1f6ef3ab32912cb51da1a967cf8e.1582702694.git.riteshh@linux.ibm.com> <20200226130503.GY24185@bombadil.infradead.org> <20200226161742.GB8036@magnolia> <20200226172653.GW10728@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200226172653.GW10728@quack2.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=X6os11be c=1 sm=1 tr=0 a=mqTaRPt+QsUAtUurwE173Q==:117 a=mqTaRPt+QsUAtUurwE173Q==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=l697ptgUJYAA:10 a=7-415B0cAAAA:8 a=UuCfLdhhvHlUIZ91etcA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Feb 26, 2020 at 06:26:53PM +0100, Jan Kara wrote: > On Wed 26-02-20 08:17:42, Darrick J. Wong wrote: > > On Wed, Feb 26, 2020 at 05:05:03AM -0800, Matthew Wilcox wrote: > > > On Wed, Feb 26, 2020 at 03:27:08PM +0530, Ritesh Harjani wrote: > > > > Currently FIEMAP_EXTENT_LAST is not working consistently across > > > > different filesystem's fiemap implementations and thus this feature > > > > may be broken. So fix the documentation about this flag to meet the > > > > right expectations. > > > > > > Are you saying filesystems have both false positives and false negatives? > > > I can understand how a filesystem might fail to set FIEMAP_EXTENT_LAST, > > > but not how a filesystem might set it when there's actually another > > > extent beyond this one. > > > > > > > * FIEMAP_EXTENT_LAST > > > > -This is the last extent in the file. A mapping attempt past this > > > > -extent will return nothing. > > > > +This is generally the last extent in the file. A mapping attempt past this > > > > +extent may return nothing. But the user must still confirm by trying to map > > > > +past this extent, since different filesystems implement this differently. > > > > "This flag means nothing and can be set arbitrarily by the fs for the lulz." > > > > Yuck. I was really hoping for "This is set on the last extent record in > > the dataset generated by the query parameters", particularly becaue > > that's how e2fsprogs utilties interpret that flag. > > The problem is that in some cases, we cannot determine whether the flag > should be set without doing work equivalent to another fiemap call. And it > just seems pointless to try to provide the flag in those cases. > > But I agree with Matthew that seeing the flag without the extent really > being the last one shouldn't happen (unless someone is changing the file). Which, of course, can happen. And it can even be the kernel (e.g. data writeback converting delalloc extents). IOWs, the information returned to userspace is out of date before it even gets to userspace, so userspace can't rely on the LAST flag to be correct in any situation. That's just an extension of the fact that userspace cannot rely on the extent map being correct and accurate in any situation.... Cheers, Dave. -- Dave Chinner david@fromorbit.com