History log of /linux-6.15/fs/bcachefs/alloc_background.c (Results 1 – 25 of 357)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1
# 39ebd748 02-Apr-2025 Kent Overstreet <[email protected]>

bcachefs: Fix null ptr deref in invalidate_one_bucket()

bch2_backpointer_get_key() returns bkey_s_c_null when the target isn't
found.

backpointer_get_key() flags the error, so there's nothing else

bcachefs: Fix null ptr deref in invalidate_one_bucket()

bch2_backpointer_get_key() returns bkey_s_c_null when the target isn't
found.

backpointer_get_key() flags the error, so there's nothing else to do
here - just skip it and move on.

Link: https://github.com/koverstreet/bcachefs/issues/847
Signed-off-by: Kent Overstreet <[email protected]>

show more ...


Revision tags: v6.14
# 9180ad2e 21-Mar-2025 Kent Overstreet <[email protected]>

bcachefs: Kill btree_iter.trans

This was planned to be done ages ago, now finally completed; there are
places where we have quite a few btree_trans objects on the stack, so
this reduces stack usage

bcachefs: Kill btree_iter.trans

This was planned to be done ages ago, now finally completed; there are
places where we have quite a few btree_trans objects on the stack, so
this reduces stack usage somewhat.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# dcffc3b1 30-Mar-2025 Kent Overstreet <[email protected]>

bcachefs: Split up bch_dev.io_ref

We now have separate per device io_refs for read and write access.

This fixes a device removal bug where the discard workers were still
running while we're removin

bcachefs: Split up bch_dev.io_ref

We now have separate per device io_refs for read and write access.

This fixes a device removal bug where the discard workers were still
running while we're removing alloc info for that device.

It's also a bit of hardening; we no longer allow writes to devices that
are read-only.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# 1ece5323 26-Mar-2025 Kent Overstreet <[email protected]>

bcachefs: Consistent indentation of multiline fsck errors

Add the new helper printbuf_indent_add_nextline(), and use it in
__bch2_fsck_err() to centralize setting the indentation of multiline
fsck e

bcachefs: Consistent indentation of multiline fsck errors

Add the new helper printbuf_indent_add_nextline(), and use it in
__bch2_fsck_err() to centralize setting the indentation of multiline
fsck errors.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# 2dd202db 26-Mar-2025 Kent Overstreet <[email protected]>

bcachefs: Recovery no longer holds state_lock

state_lock guards against devices coming or leaving, changing state, or
the filesystem changing between ro <-> rw.

But it's not necessary for running r

bcachefs: Recovery no longer holds state_lock

state_lock guards against devices coming or leaving, changing state, or
the filesystem changing between ro <-> rw.

But it's not necessary for running recovery passes, and holding it
blocks asynchronous events that would cause us to go RO or kick out
devices.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# f4a584f4 21-Mar-2025 Kent Overstreet <[email protected]>

bcachefs: bch2_disk_accounting_mod2()

We're hitting some issues with uninitialized struct padding, flagged by
kmsan.

They appear to be falso positives, otherwise bch2_accounting_validate()
would ha

bcachefs: bch2_disk_accounting_mod2()

We're hitting some issues with uninitialized struct padding, flagged by
kmsan.

They appear to be falso positives, otherwise bch2_accounting_validate()
would have flagged them as "junk at end". But for now, we'll need to
initialize disk_accounting_pos with memset().

This adds a new helper, bch2_disk_accounting_mod2(), that initializes a
disk_accounting_pos and does the accounting mod all at once - so overall
things actually get slightly more ergonomic.

BCH_DISK_ACCOUNTING_replicas keys are left for now; KMSAN isn't warning
about them and they're a bit special.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# 8a9f3d05 20-Mar-2025 Kent Overstreet <[email protected]>

bcachefs: EIO cleanup

Replace these with proper private error codes, so that when we get an
error message we're not sifting through the entire codebase to see where
it came from.

Signed-off-by: Ken

bcachefs: EIO cleanup

Replace these with proper private error codes, so that when we get an
error message we're not sifting through the entire codebase to see where
it came from.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


Revision tags: v6.14-rc7
# 80be08cd 13-Mar-2025 Kent Overstreet <[email protected]>

bcachefs: Filesystem discard option now propagates to devices

the discard option is special, because it's both a filesystem and a
device option.

When set at the filesytsem level, it's supposed to p

bcachefs: Filesystem discard option now propagates to devices

the discard option is special, because it's both a filesystem and a
device option.

When set at the filesytsem level, it's supposed to propagate to (if set
persistently via sysfs) or override (if non persistently as a mount
option) the devices - that now works correctly.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# bafd41b4 10-Mar-2025 Thorsten Blum <[email protected]>

bcachefs: Fix error type in bch2_alloc_v3_validate()

Use error type alloc_v3_unpack_error in bch2_alloc_v3_validate().

Fixes: b65db750e2bb ("bcachefs: Enumerate fsck errors")
Signed-off-by: Thorste

bcachefs: Fix error type in bch2_alloc_v3_validate()

Use error type alloc_v3_unpack_error in bch2_alloc_v3_validate().

Fixes: b65db750e2bb ("bcachefs: Enumerate fsck errors")
Signed-off-by: Thorsten Blum <[email protected]>
Signed-off-by: Kent Overstreet <[email protected]>

show more ...


Revision tags: v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2
# 6756e385 08-Feb-2025 Kent Overstreet <[email protected]>

bcachefs: bcachefs_metadata_version_stripe_lru

Add a persistent LRU for stripes, ordered by "number of empty blocks",
i.e. order in which we wish to reuse them.

This will replace the in-memory stri

bcachefs: bcachefs_metadata_version_stripe_lru

Add a persistent LRU for stripes, ordered by "number of empty blocks",
i.e. order in which we wish to reuse them.

This will replace the in-memory stripes heap, so we can kill off reading
stripes into memory at startup.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# 69bd8a92 08-Feb-2025 Kent Overstreet <[email protected]>

bcachefs: Advance bch_alloc.oldest_gen if no stale pointers

Now that we've got cached backpointers and aren't leaving around stale
pointers on bucket invalidation, we no longer need the periodic (ra

bcachefs: Advance bch_alloc.oldest_gen if no stale pointers

Now that we've got cached backpointers and aren't leaving around stale
pointers on bucket invalidation, we no longer need the periodic (rare)
gc_gens - which recalculates each bucket's oldest gen to avoid wraparound.

We can't delete that code because we've got to support existing
filesystems that will still have stale pointers, but this gets rid of
another scalability limit.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# 942a418c 07-Feb-2025 Kent Overstreet <[email protected]>

bcachefs: Invalidate cached data by backpointers

If we don't leave stale pointers around, we won't have to deal with
bucket gen wraparound.

Signed-off-by: Kent Overstreet <[email protected]>


# 3aff608b 10-Feb-2025 Kent Overstreet <[email protected]>

bcachefs: decouple bch2_lru_check_set() from alloc btree

Pass in the backpointer explicitly, instead of assuming 'referring_k' is
an alloc key and calculating it.

Signed-off-by: Kent Overstreet <ke

bcachefs: decouple bch2_lru_check_set() from alloc btree

Pass in the backpointer explicitly, instead of assuming 'referring_k' is
an alloc key and calculating it.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# b8e37c16 10-Feb-2025 Kent Overstreet <[email protected]>

bcachefs: s/BCH_LRU_FRAGMENTATION_START/BCH_LRU_BUCKET_FRAGMENTATION/

FRAGMENTATION_START was incorrect, there's currently only one
fragmentation LRU (at the end of the reserved bits for LRU type),

bcachefs: s/BCH_LRU_FRAGMENTATION_START/BCH_LRU_BUCKET_FRAGMENTATION/

FRAGMENTATION_START was incorrect, there's currently only one
fragmentation LRU (at the end of the reserved bits for LRU type), and
we're getting ready to add a stripe fragmentation lru - so give it a
better name.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# e1304967 10-Feb-2025 Kent Overstreet <[email protected]>

bcachefs: bch2_lru_change() checks for no-op

Minor cleanup, no reason for the caller to have to this.

Signed-off-by: Kent Overstreet <[email protected]>


# b7f648e2 07-Feb-2025 Kent Overstreet <[email protected]>

bcachefs: Add comment explaining why asserts in invalidate_one_bucket() are impossible

Signed-off-by: Kent Overstreet <[email protected]>


Revision tags: v6.14-rc1
# 5ee760f6 30-Jan-2025 Kent Overstreet <[email protected]>

bcachefs: BCH_COUNTER_bucket_discard_fast

Add a separate counter for fastpath bucket discards, which don't require
a journal flush.

Signed-off-by: Kent Overstreet <[email protected]>


# 9e903352 27-Jan-2025 Kent Overstreet <[email protected]>

bcachefs: Fix discard path journal flushing

The discard path is supposed to issue journal flushes when there's too
many buckets empty buckets that need a journal commit before they can be
written to

bcachefs: Fix discard path journal flushing

The discard path is supposed to issue journal flushes when there's too
many buckets empty buckets that need a journal commit before they can be
written to again, but at some point this code seems to have been lost.

Bring it back with a new optimization to make sure we don't issue too
many journal flushes: the journal now tracks the sequence number of the
most recent flush in progress, which the discard path uses when deciding
which buckets need a journal flush.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


Revision tags: v6.13, v6.13-rc7, v6.13-rc6
# ae153f2e 04-Jan-2025 Kent Overstreet <[email protected]>

bcachefs: Don't use BTREE_ITER_cached when walking alloc btree during fsck

No need to pull the whole alloc btree into the btree key cache.

Signed-off-by: Kent Overstreet <[email protected]>


Revision tags: v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2
# 9e779f3f 07-Dec-2024 Kent Overstreet <[email protected]>

bcachefs: Fix reuse of bucket before journal flush on multiple empty -> nonempty transition

For each bucket we track when the bucket became nonempty and when it
became empty again: if we can ensure

bcachefs: Fix reuse of bucket before journal flush on multiple empty -> nonempty transition

For each bucket we track when the bucket became nonempty and when it
became empty again: if we can ensure that there will be no journal
flushes in the range [nonempty, empty) (possibly because they occured at
the same journal sequence number), then it's safe to reuse the bucket
without waiting for a journal commit.

This is a major performance optimization for erasure coding, where
writes are initially replicated, but the extra replicas are quickly
dropped: if those buckets are reused and overwritten without issuing a
cache flush to the underlying device, then they only cost bus bandwidth.

But there's a tricky corner case when there's multiple empty -> nonempty
-> empty transitions in quick succession, i.e. when data is getting
overwritten immediately as it's being written.

If this happens and the previous empty transition hasn't been flushed,
we need to continue tracking the previous nonempty transition - not
start a new one.

Fixing this means we now need to track both the nonempty and empty
transitions in bch_alloc_v4.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# 89e74ecc 08-Dec-2024 Kent Overstreet <[email protected]>

bcachefs: bch2_journal_noflush_seq() now takes [start, end)

Harder to screw up if we're explicit about the range, and more correct
as journal reservations can be outstanding on multiple journal entr

bcachefs: bch2_journal_noflush_seq() now takes [start, end)

Harder to screw up if we're explicit about the range, and more correct
as journal reservations can be outstanding on multiple journal entries
simultaneously.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# be565740 08-Dec-2024 Kent Overstreet <[email protected]>

bcachefs: Set bucket needs discard, inc gen on empty -> nonempty transition

Signed-off-by: Kent Overstreet <[email protected]>


Revision tags: v6.13-rc1
# 2cd85fea 29-Nov-2024 Kent Overstreet <[email protected]>

bcachefs: Don't recurse in check_discard_freespace_key

When calling check_discard_freeespace_key from the allocator, we can't
repair without recursing - run it asynchronously instead.

Signed-off-by

bcachefs: Don't recurse in check_discard_freespace_key

When calling check_discard_freeespace_key from the allocator, we can't
repair without recursing - run it asynchronously instead.

Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# 0eafe758 28-Nov-2024 Kent Overstreet <[email protected]>

bcachefs: Check for bucket journal seq in the future

This fixes an assertion pop in bch2_journal_noflush_seq() - log the
error to the superblock and continue instead.

Reported-by: syzbot+85700120f7

bcachefs: Check for bucket journal seq in the future

This fixes an assertion pop in bch2_journal_noflush_seq() - log the
error to the superblock and continue instead.

Reported-by: [email protected]
Signed-off-by: Kent Overstreet <[email protected]>

show more ...


# 052210c3 28-Nov-2024 Kent Overstreet <[email protected]>

bcachefs: Don't error out when logging fsck error

Signed-off-by: Kent Overstreet <[email protected]>


12345678910>>...15