aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.h
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-10-30 16:43:25 +0200
committerDavid Sterba <dsterba@suse.com>2018-12-17 14:51:38 +0100
commitfbc6feaec98ac0c6a615bbe9e17c5689a1a84650 (patch)
tree0967900f3d1d6b94d5550743db9de0b83a2a5c69 /fs/btrfs/volumes.h
parentbtrfs: Remove fsid/metadata_fsid fields from btrfs_info (diff)
downloadlinux-dev-fbc6feaec98ac0c6a615bbe9e17c5689a1a84650.tar.xz
linux-dev-fbc6feaec98ac0c6a615bbe9e17c5689a1a84650.zip
btrfs: Add handling for disk split-brain scenario during fsid change
Even though fsid change without rewrite is a very quick operation it's still possible to experience a split-brain scenario if power loss occurs at the most inconvenient time. This patch handles the case where power failure occurs while the first transaction (the one setting CHANGING_FSID_V2) flag is being persisted on disk. This can cause the btrfs_fs_devices of this filesystem to be created by a device which: a) has the CHANGING_FSID_V2 flag set but its fsid value is intact b) or a device which doesn't have CHANGING_FSID_V2 flag set and its fsid value is intact This situation is trivially handled by the current find_fsid code since in both cases the devices are going to be treated like ordinary devices. Since btrfs is always mounted using the superblock of the latest device (the one with highest generation number), meaning it will have the CHANGING_FSID_V2 flag set, ensure it's being cleared on mount. On the first transaction commit following mount all disks will have it cleared. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.h')
0 files changed, 0 insertions, 0 deletions