diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-27 21:02:27 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-05 23:24:19 -0500 |
commit | 6b00de06f51c5388f1a7eddd4ad7df8e3b8863b5 (patch) | |
tree | e80ec5da1fcaac8664c2b8e8788a0d76c172597c /fs/bcachefs/bcachefs_format.h | |
parent | 62719cf33c3ad62986130a19496cd864a0ed06c3 (diff) |
bcachefs: bch_member->seq
Add new fields for split brain detection:
- bch_member->seq, which tracks the sequence number of the last superblock
write that happened to each member device
- bch_sb->write_time, which tracks the time of the last superblock write,
to allow detection of when two members have diverged but had the same
number of superblock writes.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs_format.h')
-rw-r--r-- | fs/bcachefs/bcachefs_format.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h index 2c09b40a15b9..eb2df422ae5a 100644 --- a/fs/bcachefs/bcachefs_format.h +++ b/fs/bcachefs/bcachefs_format.h @@ -1303,6 +1303,7 @@ struct bch_member { __le64 errors[BCH_MEMBER_ERROR_NR]; __le64 errors_at_reset[BCH_MEMBER_ERROR_NR]; __le64 errors_reset_time; + __le64 seq; }; #define BCH_MEMBER_V1_BYTES 56 @@ -1729,7 +1730,9 @@ struct bch_sb_field_downgrade { x(deleted_inodes, BCH_VERSION(1, 2), \ BIT_ULL(BCH_RECOVERY_PASS_check_inodes)) \ x(rebalance_work, BCH_VERSION(1, 3), \ - BIT_ULL(BCH_RECOVERY_PASS_set_fs_needs_rebalance)) + BIT_ULL(BCH_RECOVERY_PASS_set_fs_needs_rebalance)) \ + x(member_seq, BCH_VERSION(1, 4), \ + 0) enum bcachefs_metadata_version { bcachefs_metadata_version_min = 9, @@ -1795,7 +1798,8 @@ struct bch_sb { __le32 time_base_hi; __le32 time_precision; - __le64 flags[8]; + __le64 flags[7]; + __le64 write_time; __le64 features[2]; __le64 compat[2]; |