You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
btrfs: do device clone using the btrfs_scan_one_device
When we add a device to the RO mounted seed device, it becomes a
RW sprout FS. The following steps are used to hold the seed and
sprout fs_devices.
(first two steps are not mandatory for the sprouting, they are there
to ensure the seed device remains in the scanned state)
. Clone the (mounted) fs_devices, lets call it as old_devices
. Now add old_devices to fs_uuids (yeah, there is duplicate fsid in the
list, as we are under uuid_mutex so its fine).
. Alloc a new fs_devices, lets call it as seed_devices
. Copy fs_devices into the seed_devices
. Move fs_devices::devices into seed_devices::devices
. Bring seed_devices to under fs_devices::seed
(fs_devices->seed = seed_devices)
. Assign a new FSID to the fs_devices and add the new writable device
to the fs_devices.
This patch makes the following changes..
As we clone fs_devices to make sure the device remains scanned after the
sprouting. So use the btrfs_scan_one_device() code instead. And do it
at the end of the sprouting.
Signed-off-by: Anand Jain <[email protected]>
0 commit comments