diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-28 04:02:27 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-06 07:24:19 +0300 |
commit | 6b00de06f51c5388f1a7eddd4ad7df8e3b8863b5 (patch) | |
tree | e80ec5da1fcaac8664c2b8e8788a0d76c172597c /fs/bcachefs/sb-members.c | |
parent | 62719cf33c3ad62986130a19496cd864a0ed06c3 (diff) | |
download | linux-6b00de06f51c5388f1a7eddd4ad7df8e3b8863b5.tar.xz |
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/sb-members.c')
-rw-r--r-- | fs/bcachefs/sb-members.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/sb-members.c b/fs/bcachefs/sb-members.c index 7c5db669a467..4c19a8096c1d 100644 --- a/fs/bcachefs/sb-members.c +++ b/fs/bcachefs/sb-members.c @@ -235,6 +235,11 @@ static void member_to_text(struct printbuf *out, prt_printf(out, "(never)"); prt_newline(out); + prt_printf(out, "Last superblock write:"); + prt_tab(out); + prt_u64(out, le64_to_cpu(m.seq)); + prt_newline(out); + prt_printf(out, "State:"); prt_tab(out); prt_printf(out, "%s", |