public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] fs: Support btrfs cloned images and overlayfs
@ 2026-01-14  4:31 André Almeida
  2026-01-14  4:31 ` [PATCH 1/3] exportfs: Rename get_uuid() to get_disk_uuid() André Almeida
                   ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: André Almeida @ 2026-01-14  4:31 UTC (permalink / raw)
  To: Christoph Hellwig, Chuck Lever, Jeff Layton, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Carlos Maiolino,
	Amir Goldstein, Chris Mason, David Sterba, Miklos Szeredi,
	Christian Brauner, Alexander Viro, Jan Kara
  Cc: linux-nfs, linux-kernel, linux-xfs, linux-fsdevel, linux-btrfs,
	linux-unionfs, kernel-dev, André Almeida

Hi everyone,

As I reported some time ago, btrfs cloned images support and overlayfs
"index" check don't get along together[1]. Every time the same image
cloned is mounted, btrfs assigns a new random UUID for it to avoid
clashing with the exist UUID. This UUID is then used by overlayfs origin
check, to avoid reusing the same directory for a different filesystem.
Remounting the same filesystem in the same directory is supported, but
the different random UUIDs will make the check fail.

In an attempt to solve this, I reused export_operations::get_uuid() for
this purpose, to get the "real" UUID of a image, regardless of the
random UUID being exposed to userspace. overlayfs then use this UUID
internally for the origin check, and the remounting finally works.

I understand that not everyone is happy about repurposing get_uuid() for
that, but I'm totally open for going in another direction for solving
this problem not only for the combination of btrfs+overlayfs, but for
any filesytem that have similar issues with random UUIDs.

Using `btrfstune -m` or similar to change the cloned image UUID doesn't
work for the SteamOS use case, as we, well... use the UUIDs to identify
unmounted images and check if they are the same.

This series is based on top of another series[2], that should be available
at vfs-7.0.misc by now.

Thanks!

[1] https://lore.kernel.org/lkml/20251014015707.129013-1-andrealmeid@igalia.com/
[2] https://lore.kernel.org/lkml/20260112-tonyk-fs_uuid-v1-0-acc1889de772@igalia.com/

---
André Almeida (3):
      exportfs: Rename get_uuid() to get_disk_uuid()
      btrfs: Implement get_disk_uuid()
      ovl: Use real disk UUID for origin file handles

 fs/btrfs/export.c        | 20 ++++++++++++++++++++
 fs/nfsd/blocklayout.c    |  2 +-
 fs/nfsd/nfs4layouts.c    |  2 +-
 fs/overlayfs/copy_up.c   | 22 ++++++++++++++++++++--
 fs/xfs/xfs_export.c      |  2 +-
 fs/xfs/xfs_pnfs.c        |  2 +-
 fs/xfs/xfs_pnfs.h        |  2 +-
 include/linux/exportfs.h |  8 +++++---
 8 files changed, 50 insertions(+), 10 deletions(-)
---
base-commit: 336cebc7376296b2c25cf8433ff62b71fe929b0d
change-id: 20260114-tonyk-get_disk_uuid-f0d475ed170c

Best regards,
-- 
André Almeida <andrealmeid@igalia.com>


^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2026-02-17 13:27 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox