Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2887995lqz; Wed, 3 Apr 2024 11:20:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZ1xULo4R+kdHsVgfv3SBJXPPo9Snp3U/Gi/wt0wQdFGMgKoAsEcgwja3PieSCUgKptArRKzEj/oz/3VM+WoYQeNIenirZqSuVBDU6Vw== X-Google-Smtp-Source: AGHT+IFRfCL6m4+8Od9qKVj8Jfhghzzh6HiOtO66KURdGOIe/CUjQ0FEivZj0kV0Gqa2Xj0hFtat X-Received: by 2002:a05:6870:5d85:b0:22a:b3cd:1d7e with SMTP id fu5-20020a0568705d8500b0022ab3cd1d7emr140402oab.27.1712168438134; Wed, 03 Apr 2024 11:20:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712168438; cv=pass; d=google.com; s=arc-20160816; b=PVvJFy6j0g46IzeRXlRbmdmgIOGWfXNy0vMSo1P4L4Giu015jP56PxVXzyBAVB7wuT U4phTzvth+2hLDMAUz4WKPPl0aQOII8C6j5YYv5YoVjsnh8WzF66G42EL2yFisnZEllg w3W+Qdp7zYr2WjkGyth/O0TZY8Dur+u8vuBQRS1IIbw+EtDOpDPdtWfNzwh0DsQPYUL/ j353WkbzoduAj6DFYPoNEEQB0c9HakYEMlf9+1Qxw7hXBBWh5cBXnRbd98adm2nH+WWB KsDmoUAWOryDyAr+lN5yo6rumDM+gMi9+GQopeQgbXd1LGkrczuOdoGZdBSqzxgrV4mj 2ACw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kgGG71+PbmfI0fq3O+MCRO61PbQZUSP4YiW3koKj+XY=; fh=XpEMHe3GIXBzvfQ757eKisA+DAIQvNsy7ChDTSNxHWc=; b=dwLLdLxfDdPgGGpWPMjmJkpd0EDXkjh8+1moxil22sw8l99JOTuT+46of6RqDuq0GU 4UCOWu7SpTISL/6ub6aRZbapuf8/xpyzSalHBdg3WI/RNs5zTsGgcCJFu6TwFteUshF2 UNpbq7I1W63vwWcriO1KbbRTowDTzm+fC7Mj7XRy7OLLaGR14nO/23eAn+msDOVSbA+l B2+Zi+XRj6LsLDn9HZE/bxuK/Gu9/btW2GcKS103wCGSiMmYRvDz5P1lj886gAjZrASd MZ9JivCxxzMG4CauPpF6vJv/kKcDQd3gQRBC8BPvzv5zMhn7pECVdr3tdOeYiUlBRlSq tt9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P+29GNYu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-130433-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130433-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l15-20020a05620a0c0f00b0078bea631462si5332204qki.322.2024.04.03.11.20.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 11:20:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130433-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P+29GNYu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-130433-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130433-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D4F411C22B35 for ; Wed, 3 Apr 2024 18:20:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B1D7415382C; Wed, 3 Apr 2024 18:20:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P+29GNYu" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B08DB1534F2; Wed, 3 Apr 2024 18:20:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712168423; cv=none; b=d3kIdxCAOuFa0DeSN7rvkik4XmGI0WQTEpR88mN87M9jfTqeGJH820alJhpf40W6/4gh3mOaOd5del3F4eD5IlsrjN99DmYN0+ZmlBo08dLXu3Nd7+zaXdmE+MhmdvTbypFOVOnaaGTVUgWfvqh60+IdVukcJqfzSsnTgp9/Lbw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712168423; c=relaxed/simple; bh=dKvQPTXecftDT+DnIIwHEnA6Z/BLqGb2biglQSFhZeY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UFF09ngcyZrLXNbFYKmRaiIN5pUx8GAsiWaR/J2LlSJ+NU9IZ7ESKCQojkdKV+XDXMEDjWtmmHbCO0WWkBcPhK3tGVsVW3BCnnDOV4EhgJnnB41ZW364t+9VDLSufvs6pGmC02vXX2WfFBZNsr1WPbcjJouduXnquQUawrsnq0g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P+29GNYu; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30722C433C7; Wed, 3 Apr 2024 18:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712168423; bh=dKvQPTXecftDT+DnIIwHEnA6Z/BLqGb2biglQSFhZeY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P+29GNYuQx0VUmcsHNAcViKqPDDq3ZFBXvXQk8i5X/Ng9rS0Nn5TR2ZFKpItLWJoz AxQT8f9QGCIMrVhK1tfOsWr/ibXybNTHcuh13+EwHlmZmzl6cHhaXAIJFA2kXoY8nj Eb9fEuRHhhO+5iGTBPB7lLoN0d0TNvxS1vVTWNROU6LwDNr45oZ1dar1YVARAXcn8w LqRoDraupidvfHDGwIQvORPlSb6lScoO5H1ipbe0TmVYlxpqNjDw0D5fFjn1h/DyZj FFLK6Xci6djMMnMU73EvCh8gOPGDnRrFucf6kgrgZvpN41PbVwUI0e2bWiNpZ+LDQT 6+Do0ENej/RcQ== Date: Wed, 3 Apr 2024 11:20:22 -0700 From: "Darrick J. Wong" To: Kent Overstreet Cc: Sweet Tea Dorminy , Jonathan Corbet , Brian Foster , Chris Mason , Josef Bacik , David Sterba , Jaegeuk Kim , Chao Yu , Alexander Viro , Christian Brauner , Jan Kara , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-bcachefs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH v3 00/13] fiemap extension for more physical information Message-ID: <20240403182022.GB6375@frogsfrogsfrogs> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Apr 03, 2024 at 02:17:26PM -0400, Kent Overstreet wrote: > On Wed, Apr 03, 2024 at 03:22:41AM -0400, Sweet Tea Dorminy wrote: > > For many years, various btrfs users have written programs to discover > > the actual disk space used by files, using root-only interfaces. > > However, this information is a great fit for fiemap: it is inherently > > tied to extent information, all filesystems can use it, and the > > capabilities required for FIEMAP make sense for this additional > > information also. > > > > Hence, this patchset adds various additional information to fiemap, > > and extends filesystems (but not iomap) to return it. This uses some of > > the reserved padding in the fiemap extent structure, so programs unaware > > of the changes will be unaffected. > > > > This is based on next-20240403. I've tested the btrfs part of this with > > the standard btrfs testing matrix locally and manually, and done minimal > > testing of the non-btrfs parts. > > > > I'm unsure whether btrfs should be returning the entire physical extent > > referenced by a particular logical range, or just the part of the > > physical extent referenced by that range. The v2 thread has a discussion > > of this. > > I believe there was some talk of using the padding for a device ID, so > that fiemap could properly support multi device filesystems. Are we sure > this is the best use of those bytes? We still have 5x u32 of empty space in struct fiemap after this series, so I don't think adding the physical length is going to prohibit future expansion. --D > > > > Changelog: > > > > v3: > > - Adapted all the direct users of fiemap, except iomap, to emit > > the new fiemap information, as far as I understand the other > > filesystems. > > > > v2: > > - Adopted PHYS_LEN flag and COMPRESSED flag from the previous version, > > as per Andreas Dilger' comment. > > https://patchwork.ozlabs.org/project/linux-ext4/patch/4f8d5dc5b51a43efaf16c39398c23a6276e40a30.1386778303.git.dsterba@suse.cz/ > > - https://lore.kernel.org/linux-fsdevel/cover.1711588701.git.sweettea-kernel@dorminy.me/T/#t > > > > v1: https://lore.kernel.org/linux-fsdevel/20240315030334.GQ6184@frogsfrogsfrogs/T/#t > > > > Sweet Tea Dorminy (13): > > fs: fiemap: add physical_length field to extents > > fs: fiemap: update fiemap_fill_next_extent() signature > > fs: fiemap: add new COMPRESSED extent state > > btrfs: fiemap: emit new COMPRESSED state. > > btrfs: fiemap: return extent physical size > > nilfs2: fiemap: return correct extent physical length > > ext4: fiemap: return correct extent physical length > > f2fs: fiemap: add physical length to trace_f2fs_fiemap > > f2fs: fiemap: return correct extent physical length > > ocfs2: fiemap: return correct extent physical length > > bcachefs: fiemap: return correct extent physical length > > f2fs: fiemap: emit new COMPRESSED state > > bcachefs: fiemap: emit new COMPRESSED state > > > > Documentation/filesystems/fiemap.rst | 35 ++++++++++---- > > fs/bcachefs/fs.c | 17 +++++-- > > fs/btrfs/extent_io.c | 72 ++++++++++++++++++---------- > > fs/ext4/extents.c | 3 +- > > fs/f2fs/data.c | 36 +++++++++----- > > fs/f2fs/inline.c | 7 +-- > > fs/ioctl.c | 11 +++-- > > fs/iomap/fiemap.c | 2 +- > > fs/nilfs2/inode.c | 18 ++++--- > > fs/ntfs3/frecord.c | 7 +-- > > fs/ocfs2/extent_map.c | 10 ++-- > > fs/smb/client/smb2ops.c | 1 + > > include/linux/fiemap.h | 2 +- > > include/trace/events/f2fs.h | 10 ++-- > > include/uapi/linux/fiemap.h | 34 ++++++++++--- > > 15 files changed, 178 insertions(+), 87 deletions(-) > > > > > > base-commit: 75e31f66adc4c8d049e8aac1f079c1639294cd65 > > -- > > 2.43.0 > > >