linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] FSID change kernel support
@ 2018-08-29  8:36 Nikolay Borisov
  2018-08-29  8:36 ` [PATCH 1/2] btrfs: Introduce support for FSID change without metadata rewrite Nikolay Borisov
  2018-08-29  8:36 ` [PATCH 2/2] btrfs: Remove fsid/metadata_fsid fields from btrfs_info Nikolay Borisov
  0 siblings, 2 replies; 3+ messages in thread
From: Nikolay Borisov @ 2018-08-29  8:36 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

Here is the kernel support for another level of indirection when dealing with 
FSID. I've taken inspiration from XFS so if people are familiar how FSID is 
changed there it's identical in BTRFS. In short, another field is introduced
which will record the original fsid (which is stamped into every metadata block
on-disk) if the user chooses to change it. This enables filesytems to have 
arbitrary user-visible UUIDS but immutable on-disk UUIDs. 

The first patch adjusts the kernel code to cope with this by adding an incompat
flag and introducing a new field to the on-disk super block. This means old
kernels will not be able to mount fsid-changed filesystems. Additionally, 
the device scanning logic is modified so that now devices are being 
matched for fsid && metadata_uuid when added to the system. This handles 
scenarios where two filesystems with identical on-disk metadata uuids (but 
different user-visible fsids) exist on the same machine. 

The second patch just removes some duplication of the fsid/metadata_uuid fields
since they were copied in both btrfs_fs_info and btrfs_fs_devices structs. 

Those patches survived multiple xfstest runs so I think they should be pretty 
solid. Please review and give them a spin. 

Nikolay Borisov (2):
  btrfs: Introduce support for FSID change without metadata rewrite
  btrfs: Remove fsid/metadata_fsid fields from btrfs_info

 fs/btrfs/check-integrity.c   |  2 +-
 fs/btrfs/ctree.c             |  5 +--
 fs/btrfs/ctree.h             | 10 +++---
 fs/btrfs/disk-io.c           | 39 ++++++++++++++++++-----
 fs/btrfs/extent-tree.c       |  2 +-
 fs/btrfs/ioctl.c             |  2 +-
 fs/btrfs/super.c             |  2 +-
 fs/btrfs/volumes.c           | 74 ++++++++++++++++++++++++++++++++++----------
 fs/btrfs/volumes.h           |  1 +
 include/trace/events/btrfs.h |  2 +-
 include/uapi/linux/btrfs.h   |  1 +
 11 files changed, 104 insertions(+), 36 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2018-08-29 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-29  8:36 [PATCH 0/2] FSID change kernel support Nikolay Borisov
2018-08-29  8:36 ` [PATCH 1/2] btrfs: Introduce support for FSID change without metadata rewrite Nikolay Borisov
2018-08-29  8:36 ` [PATCH 2/2] btrfs: Remove fsid/metadata_fsid fields from btrfs_info Nikolay Borisov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).