History log of /linux-master/fs/bcachefs/sb-members.c
Revision Date Author Comments
# fa845c73 16-Apr-2024 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: Fix bch2_dev_btree_bitmap_marked_sectors() shift

Fixes: 27c15ed297cb bcachefs: bch_member.btree_allocated_bitmap
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# 27c15ed2 12-Apr-2024 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: bch_member.btree_allocated_bitmap

This adds a small (64 bit) per-device bitmap that tracks ranges that
have btree nodes, for accelerating btree node scan if it is ever needed.

- New helpers, bch2_dev_btree_bitmap_marked() and
bch2_dev_bitmap_mark(), for checking and updating the bitmap

- Interior btree update path updates the bitmaps when required

- The check_allocations pass has a new fsck_err check,
btree_bitmap_not_marked

- New on disk format version, mi_btree_mitmap, which indicates the new
bitmap is present

- Upgrade table lists the required recovery pass and expected fsck error

- Btree node scan uses the bitmap to skip ranges if we're on the new
version

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# 04eb5793 10-Feb-2024 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: fix missing endiannes conversion in sb_members

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# e58f963c 06-Jan-2024 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: helpers for printing data types

We need bounds checking since new versions may introduce new data types.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# f60250de 29-Dec-2023 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: Fix printing of device durability

BCH_MEMBER_DURABILITY() was not present initially; a value of 0 means
use the default, nonzero means use v - 1.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# 6b00de06 27-Jun-2023 Kent Overstreet <kent.overstreet@linux.dev>

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>


# 41b84fb4 17-Dec-2023 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: for_each_member_device_rcu() now declares loop iter

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# d05db127 24-Nov-2023 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: Print durability in member_to_text()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# 0f0fc312 31-Oct-2023 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: Move __bch2_members_v2_get_mut to sb-members.h

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# 59154f2c 31-Oct-2023 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: bch2_prt_datetime()

Improved, better named version of pr_time().

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# dc7a15fb 27-Oct-2023 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: Skip deleted members in member_to_text()

This fixes show-super output - we shouldn't be printing members that
have been deleted.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# f5d26fa3 25-Oct-2023 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: bch_sb_field_errors

Add a new superblock section to keep counts of errors seen since
filesystem creation: we'll be addingcounters for every distinct fsck
error.

The new superblock section has entries of the for [ id, count,
time_of_last_error ]; this is intended to let us see what errors are
occuring - and getting fixed - via show-super output.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# 94119eeb 25-Oct-2023 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: Add IO error counts to bch_member

We now track IO errors per device since filesystem creation.

IO error counts can be viewed in sysfs, or with the 'bcachefs
show-super' command.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# 5c1ab40e7 26-Oct-2023 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: Fix kasan splat in members_v1_get()

This fixes an incorrect memcpy() in the recent members_v2 code - a
members_v1 member is BCH_MEMBER_V1_BYTES, not sizeof(struct bch_member).

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# 4637429e 26-Sep-2023 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: bch2_sb_field_get() refactoring

Instead of using token pasting to generate methods for each superblock
section, just make the type a parameter to bch2_sb_field_get().

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# 40f7914e 24-Sep-2023 Hunter Shaffer <huntershaffer182456@gmail.com>

bcachefs: Add iops fields to bch_member

Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# 9af26120 24-Sep-2023 Hunter Shaffer <huntershaffer182456@gmail.com>

bcachefs: Rename bch_sb_field_members -> bch_sb_field_members_v1

Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# 3f7b9713 24-Sep-2023 Hunter Shaffer <huntershaffer182456@gmail.com>

bcachefs: New superblock section members_v2

members_v2 has dynamically resizable entries so that we can extend
bch_member. The members can no longer be accessed with simple array
indexing Instead members_v2_get is used to find a member's exact
location within the array and returns a copy of that member.
Alternatively member_v2_get_mut retrieves a mutable point to a member.

Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# 1241df58 24-Sep-2023 Hunter Shaffer <huntershaffer182456@gmail.com>

bcachefs: Add new helper to retrieve bch_member from sb

Prep work for introducing bch_sb_field_members_v2 - introduce new
helpers that will check for members_v2 if it exists, otherwise using v1

Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>


# fb8e5b4c 05-Aug-2023 Kent Overstreet <kent.overstreet@linux.dev>

bcachefs: sb-members.c

Split out a new file for bch_sb_field_members - we'll likely want to
move more code here in the future.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>