Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2886980lqz; Wed, 3 Apr 2024 11:18:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUPF3WVgENdXuS2RI1l+16PmEkv+TbDxhCowSGu0A3OfIOuhLVDE5qSm6psdcFTJX6+1tlUPfFTzLPgxHlwA3iqdbV2IkWryuWNAS9l0w== X-Google-Smtp-Source: AGHT+IH7Wh0jJeA4CjFsZTxJBFRPF3MwrDuNweIGP/KASlBr+NAw+f53QDa8x+5xA900OqPOsAfA X-Received: by 2002:a17:906:393:b0:a4e:768a:1445 with SMTP id b19-20020a170906039300b00a4e768a1445mr70818eja.16.1712168323621; Wed, 03 Apr 2024 11:18:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712168323; cv=pass; d=google.com; s=arc-20160816; b=s8DVDsKXO5kV1K9eOMpniYhYQ6K4jEdAjXA8M3fckxI1hIjdWo2/nFJzZlHwa+fA2Q cmu6aw1x3BM3DOTdO5+tWeglm64U+jYRzfEeP1Fa8QKnPY4dnYr7CWSFb7zvDUNfZawH wI/dQF4vm6uhj9Qv0JIeLyxCeWLtDzKCT6OxsiwjYZjO1JpwR+T5BImiBpNW08A29QQP c2Z9LuF9MPRg2PgOvcsUjF4ZayiTmFKo6AnctDfTJekBiYwp/mXSw8UfVLeRuEkZbcCg KP18L5NTg95GuAyBA8afKgpRjgIkxj5/QWQpFKkXk7eqSFs3oJyYL2W1Z8/fDn7xE40o YFag== 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:dkim-signature:date; bh=Zxp27ZGGEkSjJwr51ZwgsY5W3CkCmszrW+4Pomr214w=; fh=NfnjWnPWwjToMly+8s7RzljzhE2P14jz8XwJolJj8OU=; b=IKWXm/8hYjjARnz5MKk/Yda1G0yNBA0jK6KOTE0u8FoiXtFXjYm9nU5YzUiaS+mhBy dCfj+JezEJpMREW+g3jaevs/zIu1MOxdoYR5wvTTc0z76FMLcZIfyB2JUFWcZ72gt30N jYYz28g+VUcTq5W67L6dzH83OwCrWxFtIqkip1XcfusKBTaRJbAC4NBhxjG03FcX+g9y 7I6/IKl1ARlYZsW2k9BIHVmGmSmZL9quVNYkRhBAtavdRlkgFV94ftIARXvdaJtEPCK6 MZeC7S17F3RGJs+ar/m/j+PDXz2ZZQ5GsurXnNRBP1V3LY2JKAYNFTuy8kjJiWp/aJ5z U1ZA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=LSLrjg6F; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-130431-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130431-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f1-20020a170906084100b00a4def16040csi7086643ejd.293.2024.04.03.11.18.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 11:18:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130431-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=LSLrjg6F; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-130431-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130431-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 am.mirrors.kernel.org (Postfix) with ESMTPS id BB1CA1F24D25 for ; Wed, 3 Apr 2024 18:17:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6045153BF3; Wed, 3 Apr 2024 18:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="LSLrjg6F" Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (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 CBBB115383A; Wed, 3 Apr 2024 18:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712168254; cv=none; b=DLgwBWPuAyjK3M0BX81OztB/ASc9PMxnBVte1ZAsNlZzSGoiCNzBAE0a4XDD+XOmCUr1c+GloBAWrBWU2iNynzY6EyvWFye46g+aLifAoR8+L0oUvJh+qq1arIigR5EwLCrFBJH5KiqsA19ZG+3gua7Fn6RhY645u5L48G84U5E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712168254; c=relaxed/simple; bh=hJWw3B+mhvk+J/b6HFC0YpI4aiSW9INrwrydReU7mY0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=spAAuB3gbLC4TOLo2htpnWK+myN+RVS48FdgPaBU3pdEMUanORFk/91OPRKs8lYAGDDgAuLuZi596wlYZIuWxJhWZKX3OYpYp9cCQuSFbTT1x8oQDZVKWp/5OB6pyvGkm4egQ4AzIgXhrCe/9NxPA3iShrQG15EYr3T+2uipZ0g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=LSLrjg6F; arc=none smtp.client-ip=91.218.175.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Wed, 3 Apr 2024 14:17:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1712168250; 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: in-reply-to:in-reply-to:references:references; bh=Zxp27ZGGEkSjJwr51ZwgsY5W3CkCmszrW+4Pomr214w=; b=LSLrjg6F62U8rN5fLqsO7nbZDAU3JIcXeYeB4CrF8JqMW9VRrf4nyVis3m0zywfS0giGC6 enXhqfzZrX4UgUK7Z0Lhi26cYVInkVcP6YKMw2CUFNDWFkV6OJDXwN4InhSowAkbC/dbdA LYsEXK5LLyfXOwoAEk/SvmMiqpaOo8Y= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Sweet Tea Dorminy Cc: Jonathan Corbet , Brian Foster , Chris Mason , Josef Bacik , David Sterba , Jaegeuk Kim , Chao Yu , Alexander Viro , Christian Brauner , Jan Kara , =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , 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, djwong@kernel.org Subject: Re: [PATCH v3 00/13] fiemap extension for more physical information Message-ID: 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: X-Migadu-Flow: FLOW_OUT 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? > > 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 >