public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: "André Almeida" <andrealmeid@igalia.com>
Cc: Christoph Hellwig <hch@lst.de>,
	Chuck Lever <chuck.lever@oracle.com>,
	Jeff Layton <jlayton@kernel.org>, NeilBrown <neil@brown.name>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
	Carlos Maiolino <cem@kernel.org>,
	Amir Goldstein <amir73il@gmail.com>, Chris Mason <clm@fb.com>,
	David Sterba <dsterba@suse.com>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Christian Brauner <brauner@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-btrfs@vger.kernel.org, linux-unionfs@vger.kernel.org,
	kernel-dev@igalia.com
Subject: Re: [PATCH 1/3] exportfs: Rename get_uuid() to get_disk_uuid()
Date: Tue, 13 Jan 2026 22:10:28 -0800	[thread overview]
Message-ID: <20260114061028.GF15551@frogsfrogsfrogs> (raw)
In-Reply-To: <20260114-tonyk-get_disk_uuid-v1-1-e6a319e25d57@igalia.com>

On Wed, Jan 14, 2026 at 01:31:41AM -0300, André Almeida wrote:
> To make clear which UUID is being returned, rename get_uuid() to
> get_disk_uuid(). Expand the function documentation to note that this
> function can be also used for filesystem that supports cloned devices
> that might have different UUIDs for userspace tools, while having the
> same UUID for internal usage.

I'm not sure what a "disk uuid" is -- XFS can store two of them in the
ondisk superblock: the admin-modifiable one that blkid reports, and the
secret one that's stamped in all the metadata and cannot change.

IIRC XFS only shares the user-visible UUID, but they're both from the
disk.   Also I'm not sure what a non-disk filesystem is supposed to
provide here?

--D

> Signed-off-by: André Almeida <andrealmeid@igalia.com>
> ---
>  fs/nfsd/blocklayout.c    | 2 +-
>  fs/nfsd/nfs4layouts.c    | 2 +-
>  fs/xfs/xfs_export.c      | 2 +-
>  fs/xfs/xfs_pnfs.c        | 2 +-
>  fs/xfs/xfs_pnfs.h        | 2 +-
>  include/linux/exportfs.h | 8 +++++---
>  6 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c
> index afa16d7a8013..713a1f69f8fe 100644
> --- a/fs/nfsd/blocklayout.c
> +++ b/fs/nfsd/blocklayout.c
> @@ -218,7 +218,7 @@ nfsd4_block_get_device_info_simple(struct super_block *sb,
>  
>  	b->type = PNFS_BLOCK_VOLUME_SIMPLE;
>  	b->simple.sig_len = PNFS_BLOCK_UUID_LEN;
> -	return sb->s_export_op->get_uuid(sb, b->simple.sig, &b->simple.sig_len,
> +	return sb->s_export_op->get_disk_uuid(sb, b->simple.sig, &b->simple.sig_len,
>  			&b->simple.offset);
>  }
>  
> diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c
> index ad7af8cfcf1f..50bb29b2017c 100644
> --- a/fs/nfsd/nfs4layouts.c
> +++ b/fs/nfsd/nfs4layouts.c
> @@ -136,7 +136,7 @@ void nfsd4_setup_layout_type(struct svc_export *exp)
>  	exp->ex_layout_types |= 1 << LAYOUT_FLEX_FILES;
>  #endif
>  #ifdef CONFIG_NFSD_BLOCKLAYOUT
> -	if (sb->s_export_op->get_uuid &&
> +	if (sb->s_export_op->get_disk_uuid &&
>  	    sb->s_export_op->map_blocks &&
>  	    sb->s_export_op->commit_blocks)
>  		exp->ex_layout_types |= 1 << LAYOUT_BLOCK_VOLUME;
> diff --git a/fs/xfs/xfs_export.c b/fs/xfs/xfs_export.c
> index 201489d3de08..d09570ba7445 100644
> --- a/fs/xfs/xfs_export.c
> +++ b/fs/xfs/xfs_export.c
> @@ -244,7 +244,7 @@ const struct export_operations xfs_export_operations = {
>  	.get_parent		= xfs_fs_get_parent,
>  	.commit_metadata	= xfs_fs_nfs_commit_metadata,
>  #ifdef CONFIG_EXPORTFS_BLOCK_OPS
> -	.get_uuid		= xfs_fs_get_uuid,
> +	.get_disk_uuid		= xfs_fs_get_disk_uuid,
>  	.map_blocks		= xfs_fs_map_blocks,
>  	.commit_blocks		= xfs_fs_commit_blocks,
>  #endif
> diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c
> index afe7497012d4..6ef7b29c4060 100644
> --- a/fs/xfs/xfs_pnfs.c
> +++ b/fs/xfs/xfs_pnfs.c
> @@ -50,7 +50,7 @@ xfs_break_leased_layouts(
>   * the exported device.
>   */
>  int
> -xfs_fs_get_uuid(
> +xfs_fs_get_disk_uuid(
>  	struct super_block	*sb,
>  	u8			*buf,
>  	u32			*len,
> diff --git a/fs/xfs/xfs_pnfs.h b/fs/xfs/xfs_pnfs.h
> index 940c6c2ad88c..df82a6ba1a11 100644
> --- a/fs/xfs/xfs_pnfs.h
> +++ b/fs/xfs/xfs_pnfs.h
> @@ -3,7 +3,7 @@
>  #define _XFS_PNFS_H 1
>  
>  #ifdef CONFIG_EXPORTFS_BLOCK_OPS
> -int xfs_fs_get_uuid(struct super_block *sb, u8 *buf, u32 *len, u64 *offset);
> +int xfs_fs_get_disk_uuid(struct super_block *sb, u8 *buf, u32 *len, u64 *offset);
>  int xfs_fs_map_blocks(struct inode *inode, loff_t offset, u64 length,
>  		struct iomap *iomap, bool write, u32 *device_generation);
>  int xfs_fs_commit_blocks(struct inode *inode, struct iomap *maps, int nr_maps,
> diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
> index 262e24d83313..dc7029949a62 100644
> --- a/include/linux/exportfs.h
> +++ b/include/linux/exportfs.h
> @@ -252,8 +252,10 @@ struct handle_to_path_ctx {
>   * @commit_metadata:
>   *    @commit_metadata should commit metadata changes to stable storage.
>   *
> - * @get_uuid:
> - *    Get a filesystem unique signature exposed to clients.
> + * @get_disk_uuid:
> + *    Get a filesystem unique signature exposed to clients. It's also useful for
> + *    filesystems that support mounting cloned disks and export different UUIDs
> + *    for userspace, while being internally the same.
>   *
>   * @map_blocks:
>   *    Map and, if necessary, allocate blocks for a layout.
> @@ -282,7 +284,7 @@ struct export_operations {
>  	struct dentry * (*get_parent)(struct dentry *child);
>  	int (*commit_metadata)(struct inode *inode);
>  
> -	int (*get_uuid)(struct super_block *sb, u8 *buf, u32 *len, u64 *offset);
> +	int (*get_disk_uuid)(struct super_block *sb, u8 *buf, u32 *len, u64 *offset);
>  	int (*map_blocks)(struct inode *inode, loff_t offset,
>  			  u64 len, struct iomap *iomap,
>  			  bool write, u32 *device_generation);
> 
> -- 
> 2.52.0
> 
> 

  reply	other threads:[~2026-01-14  6:10 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14  4:31 [PATCH 0/3] fs: Support btrfs cloned images and overlayfs André Almeida
2026-01-14  4:31 ` [PATCH 1/3] exportfs: Rename get_uuid() to get_disk_uuid() André Almeida
2026-01-14  6:10   ` Darrick J. Wong [this message]
2026-01-14  6:24     ` Christoph Hellwig
2026-01-14 10:12       ` Amir Goldstein
2026-01-14 13:11         ` Christoph Hellwig
2026-01-14 16:38         ` André Almeida
2026-01-14 17:58           ` Amir Goldstein
2026-01-14  4:31 ` [PATCH 2/3] btrfs: Implement get_disk_uuid() André Almeida
2026-01-14  4:31 ` [PATCH 3/3] ovl: Use real disk UUID for origin file handles André Almeida
2026-01-14  6:26   ` Christoph Hellwig
2026-01-14 16:17     ` André Almeida
2026-01-15  6:29       ` Christoph Hellwig
2026-01-15  6:51         ` Qu Wenruo
2026-01-15  7:23           ` Christoph Hellwig
2026-01-15  8:09             ` Qu Wenruo
2026-01-15  8:31               ` Christoph Hellwig
2026-01-15 15:42             ` André Almeida
2026-01-15 16:07               ` Amir Goldstein
2026-01-15 18:55                 ` André Almeida
2026-01-16  9:36                   ` Christoph Hellwig
2026-01-16  9:55                   ` Amir Goldstein
2026-01-16 13:27                     ` André Almeida
2026-01-16 17:06                       ` Amir Goldstein
2026-01-19 16:56                         ` André Almeida
2026-01-20 15:12                           ` Amir Goldstein
2026-01-22 20:07                             ` Amir Goldstein
2026-01-23 13:24                               ` André Almeida
2026-01-23 20:08                                 ` André Almeida
2026-01-24 10:45                                   ` Amir Goldstein
2026-01-28 11:49                                     ` Amir Goldstein
2026-02-05 20:34                                       ` André Almeida
2026-02-06 13:12                                         ` Amir Goldstein
2026-02-16 14:59                                           ` André Almeida
2026-02-17 13:26                                             ` Amir Goldstein
2026-01-15 16:08               ` Christoph Hellwig
2026-01-14 17:54   ` Amir Goldstein
2026-01-15  6:36     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260114061028.GF15551@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=amir73il@gmail.com \
    --cc=andrealmeid@igalia.com \
    --cc=brauner@kernel.org \
    --cc=cem@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=jlayton@kernel.org \
    --cc=kernel-dev@igalia.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox