[GIT PULL] bcachefs fixes for 6.10-rc6

From: Kent Overstreet
Date: Fri Jun 28 2024 - 10:39:46 EST


Hi Linus, fresh batch of fixes for you...

Cheers,
Kent

The following changes since commit bd4da0462ea7bf26b2a5df5528ec20c550f7ec41:

bcachefs: Move the ei_flags setting to after initialization (2024-06-21 10:17:07 -0400)

are available in the Git repository at:

https://evilpiepirate.org/git/bcachefs.git tags/bcachefs-2024-06-28

for you to fetch changes up to 64cd7de998f393e73981e2aa4ee13e4e887f01ea:

bcachefs: Fix kmalloc bug in __snapshot_t_mut (2024-06-25 20:51:14 -0400)

----------------------------------------------------------------
bcachefs fixes for 6.10-rc6

simple stuff:
- null ptr/err ptr deref fixes
- fix for getting wedged on shutdown after journal error

- fix missing recalc_capacity() call, capacity now changes correctly
after a device goes read only

however: our capacity calculation still doesn't take into account when
we have mixed ro/rw devices and the ro devices have data on them,
that's going to be a more involved fix to separate accounting for
"capacity used on ro devices" and "capacity used on rw devices"

- boring syzbot stuff

slightly more involved:
- discard, invalidate workers are now per device
this has the effect of simplifying how we take device refs in these
paths, and the device ref cleanup fixes a longstanding race between
the device removal path and the discard path

- fixes for how the debugfs code takes refs on btree_trans objects
we have debugfs code that prints in use btree_trans objects. It uses
closure_get() on trans->ref, which is mainly for the cycle detector,
but the debugfs code was using it on a closure that may have hit 0,
which is not allowed; for performance reasons we cannot avoid having
not-in-use transactions on the global list.

introduce some new primitives to fix this and make the synchronization
here a whole lot saner

----------------------------------------------------------------
Kent Overstreet (10):
bcachefs: Fix freeing of error pointers
bcachefs: fix seqmutex_relock()
bcachefs: Make btree_deadlock_to_text() clearer
closures: closure_get_not_zero(), closure_return_sync()
bcachefs: Fix race between trans_put() and btree_transactions_read()
bcachefs: Fix btree_trans list ordering
bcachefs: Add missing recalc_capacity() call
bcachefs: Fix null ptr deref in journal_pins_to_text()
bcachefs: Add missing bch2_journal_do_writes() call
bcachefs: Discard, invalidate workers are now per device

Pei Li (3):
bcachefs: slab-use-after-free Read in bch2_sb_errors_from_cpu
bcachefs: Fix shift-out-of-bounds in bch2_blacklist_entries_gc
bcachefs: Fix kmalloc bug in __snapshot_t_mut

fs/bcachefs/alloc_background.c | 263 +++++++++++++++++++-----------------
fs/bcachefs/alloc_background.h | 6 +-
fs/bcachefs/alloc_foreground.c | 4 +-
fs/bcachefs/bcachefs.h | 16 ++-
fs/bcachefs/btree_iter.c | 19 +--
fs/bcachefs/chardev.c | 9 +-
fs/bcachefs/debug.c | 109 +++++++++------
fs/bcachefs/journal.c | 5 +
fs/bcachefs/journal_io.c | 7 +
fs/bcachefs/journal_seq_blacklist.c | 2 +-
fs/bcachefs/sb-errors.c | 14 +-
fs/bcachefs/seqmutex.h | 11 +-
fs/bcachefs/snapshot.c | 3 +
fs/bcachefs/super.c | 6 +-
include/linux/closure.h | 23 ++++
lib/closure.c | 52 ++++++-
16 files changed, 342 insertions(+), 207 deletions(-)