summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-10-23bcachefs: btree_bkey_cached_commonKent Overstreet16-203/+212
This is prep work for the btree key cache: btree iterators will point to either struct btree, or a new struct bkey_cached. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Write out fs usage consistentlyKent Overstreet14-231/+310
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Avoid write lock on mark_lockKent Overstreet3-11/+8
mark_lock is a frequently taken lock, and there's also potential for deadlocks since currently bch2_clear_page_bits which is called from memory reclaim has to take it to drop disk reservations. The disk reservation get path takes it when it recalculates the number of sectors known to be available, but it's not really needed for consistency. We just want to make sure we only have one thread updating the sectors_available count, which we can do with a dedicated mutex. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Fix a bug with multiple iterators being traversedKent Overstreet1-1/+0
If upgrade fails on one iterator, but it was copied from another iterator and will be freed before transaction restart, then the original iterator will get traversed first, so we need to make required btree nodes on the original iterator will be traversed too. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: fix bch2_rbio_narrow_crcs()Kent Overstreet1-12/+7
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Fix journal shutdown pathKent Overstreet1-0/+2
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Fix fsync error reportingKent Overstreet1-6/+6
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: bch2_bkey_ptrs_invalid()Kent Overstreet4-117/+103
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Don't hardcode BTREE_ID_EXTENTSKent Overstreet2-4/+4
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: fix bch2_flags_to_text()Kent Overstreet1-1/+1
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Add actual tracepoints for transaction restartsKent Overstreet5-4/+92
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: copy correct journal_seq to dir in createKent Overstreet1-1/+1
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Return errors from for_each_btree_key()Kent Overstreet18-184/+182
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: fix triggers for stripes btreeKent Overstreet1-0/+9
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: use same timesource as current_time()Kent Overstreet1-1/+1
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Fix hang while shutting downKent Overstreet3-11/+21
If the allocator thread exited before bch2_dev_allocator_stop() was called (because of an error), bch2_dev_allocator_quiesce() could hang. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: lockdep fix when going rw from bch2_alloc_write()Kent Overstreet1-12/+23
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Mark overwrites from journal replay in initial gcKent Overstreet6-107/+192
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Deduplicate keys in the journal before replayKent Overstreet8-103/+267
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Journal replay refactoringKent Overstreet5-240/+251
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: cmp_int()Kent Overstreet12-18/+20
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Pass flags arg to bch2_alloc_write()Kent Overstreet6-24/+24
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: allocate sb_read_scratch with __get_free_pageKent Overstreet2-3/+3
kmalloc allocations aren't guranteed alignment for io Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: delete duplicated codeKent Overstreet3-39/+16
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: disallow ever going rw if nochanges or noreplayKent Overstreet1-0/+5
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: initial gc no longer needs to touch every nodeKent Overstreet1-12/+4
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Rewrite journal_seq_blacklist machineryKent Overstreet15-472/+460
Now, we store blacklisted journal sequence numbers in the superblock, not the journal: this helps to greatly simplify the code, and more importantly it's now implemented in a way that doesn't require all btree nodes to be visited before starting the journal - instead, we unconditionally blacklist the next 4 journal sequence numbers after an unclean shutdown. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: don't lose errors from iterators that have been freedKent Overstreet2-2/+5
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: free trans->mem on commitKent Overstreet1-3/+6
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: add ability to run gc on metadata onlyKent Overstreet8-61/+88
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Convert gc errors to fsck errorsKent Overstreet1-7/+10
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: ratelimit copygc warningKent Overstreet2-1/+4
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: minor fsck fixKent Overstreet1-18/+12
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Fsck locking improvementsKent Overstreet5-57/+83
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Caller now responsible for calling mark_key for gcKent Overstreet7-58/+54
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Refactor bch2_fs_recovery()Kent Overstreet1-135/+179
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: fix bch2_trans_unlock()Kent Overstreet1-4/+4
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: add missing bch2_btree_iter_node_drop() callKent Overstreet2-8/+5
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: allow journal reply on ro mountKent Overstreet1-3/+0
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: make sure to use BTREE_INSERT_LAZY_RW in fsckKent Overstreet1-6/+15
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Track whether filesystem has errors in superblockKent Overstreet6-33/+26
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: (invalidate|release)_folio fixesKent Overstreet1-4/+1
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Assorted preemption fixesKent Overstreet4-12/+14
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Write out alloc info more carefullyKent Overstreet1-6/+8
In flight btree updates could update alloc info until they're flushed - so we have to try writing again after they've been flushed. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: fix initial gcKent Overstreet1-6/+0
Buckets weren't being marked as dirty Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Handle fsck errors at runtime betterKent Overstreet1-3/+13
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: simplify gc locking a bitKent Overstreet1-16/+11
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: move some checks to expensive_debug_checksKent Overstreet4-8/+21
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Sort updates in bch2_trans_update()Kent Overstreet2-11/+23
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-23bcachefs: Unlink not-touched iters on successful transaction commitKent Overstreet2-1/+7
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>