summaryrefslogtreecommitdiff
path: root/fs/bcachefs
AgeCommit message (Collapse)Author
5 hoursbcachefs: Kill most bch2_bkey_get_iter() usesbcachefs-testingKent Overstreet
CLASS(btree_iter, ...); peek_slot() is now more concise. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 hoursbcachefs: Read retries are after checksum errors now REQ_FUAKent Overstreet
REQ_FUA means "skip the drive cache", and it can be used with reads to. If there was a checksum error, we want to retry the whole read path, not read it from cache again. Suggested-by: Benjamin LaHaise <bcrl@kvack.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 hoursbcachefs: read_fua_testKent Overstreet
Add a sysfs attribute for checking whether read fua appears to behave properly on a device. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 hoursbcachefs: shrinker.to_text() methodsKent Overstreet
This adds shrinker.to_text() methods for our shrinkers and hooks them up to our existing to_text() functions. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 hoursbcachefs: CLASS(btree_iter)for-nextKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 hoursbcachefs: for_each_btree_key_continue() no longer exits iterKent Overstreet
Prep work for more CLASS() conversion. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 hoursbcachefs: kill trans arg to bch2_trans_iter_exit()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 hoursbcachefs: Revert "Kill btree_iter.trans"Kent Overstreet
The stack usage reduction from this patch was minimal, and reverting it lets us add CLASS() support. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 hoursbcachefs: More enum conversionKent Overstreet
Flags should not be passed as bare integers. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 hoursbcachefs: inum_to_path() now prints inum when disconnectedKent Overstreet
When we're using this in fsck, we need to make sure we don't lose information vs. just printing the inum. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Add missing error_throw to bch2_set_version_incompat()bcachefs-2025-07-28Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: live_child() no longer uses recursionKent Overstreet
We already had helpers for doing a snapshot tree walk without recursion - this fixes a stack overflow for a user with lots of snapshots. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: snapshots: pass snapshot_table where appropriateKent Overstreet
Once we have rcu_lock() we shouldn't reload c->snapshots. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Add missing ei_last_dirtied updateKent Overstreet
ei_last_dirtied tracks the process that last dirtied a file, it's used for segregating writes from different processes into different writepoints. But bch2_page_mkwrite() was missing it, leading to a KMSAN splat. Reported-by: syzbot+2caec1f3fc52004d4f3c@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: remove extraneous ; after statementsAnindya Sundar Gayen
There are a couple of statements with two following semicolons, replace these with just one semicolon. Signed-off-by: Anindya Sundar Gayen <anindya19@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: dirent_to_text() now uses prt_bytes()Kent Overstreet
Small optimization, calling into vsprintf() is heavy. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: journal_entry_btree_keys_to_text() is more carefulKent Overstreet
to_text() functions run on data structures that haven't passed validation, so they need to be more careful with bounds checks. Reported-by: syzbot+4e41a25632658c77b441@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: recovery_pass_will_run()Kent Overstreet
Add a proper helper for "we're still in recovery and we're going to run a pass", for bch2_snapshot_is_ancestor() - this fixes an incorrect check that was causing it to run the slowpath unnecessarily. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Hook up progress indicators for most recovery passesKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Increase BCH_MIN_NR_NBUCKETSKent Overstreet
We can't run with only 64 buckets anymore, due to various reserves. 512 should be a more reasonable minimum. Reported-by: syzbot+c6fd966ebbdea1e8ff08@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Add pass_done to recovery_pass_status_to_text()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Don't allow mounting with crazy numbers of dirty journal entriesKent Overstreet
We might have to initialize the journal pin fifo with a size greater than the normal max, but we can disallow crazy numbers. Reported-by: syzbot+527519da96e15b411c73@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: btree_lost_data: mark a few more errors for silent fixingKent Overstreet
Keep the log clean for harmless, expected errors. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Ensure pick_read_device() returns error for btree pointersKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Clean up btree_node_read_work() error handlingKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Only track read latency for congestion trackingKent Overstreet
Writes are subject to queing delays from page cache writeback; we don't necessarily want these considered when tracking if a device is congested for the purpose of cache promotion. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Flush btree_interior_update_work before freeing fsKent Overstreet
Avoid a UAF for the list of pending interior updates, or when the last btree_update_nodes_written() frees its btree_trans. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Fix __bch2_alloc_to_v4 copyKent Overstreet
bch_alloc_v4 is a key type that's been extended over time, so we can't do a dump struct copy - we need to check the value size. Reported-by: syzbot+487dd8c670b175dd59ed@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Convert topology repair errs to standard error codesKent Overstreet
When we log an error, this makes sure they're printed correctly. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: fix check_extent_overbig() callKent Overstreet
We can't access btree key values after a transaction commit. Reported-by: syzbot+fbc1f6040dd365cce0d8@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Use user_backed_iter instead of iter_is_iovecAlan Huang
ITER_UBUF is also one of the user backed iter, which is equivalent of single-segment iovec. DIO handling should use user_backed_iter. Signed-off-by: Alan Huang <mmpgouride@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Fix refs to undefined fields in __bch2_alloc_v4_to_text()Kent Overstreet
Recent stack usage reductions have avoided unpacking alloc keys onto the stack in a few places, but when we do so we must be careful not to reference fields that don't exist - key values can be extended with new fields over time. Reported-by: syzbot+8eb51728519f6659ef7b@syzkaller.appspotmail.com Fixes: eabef52ff881 ("bcachefs: bch2_alloc_v4_to_text()") Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: log devices we're scanning in btree node scanKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Fix allocate_dropping_locks() usageKent Overstreet
Simplify callers a bit, and make sure we're not squashing a transaction restart error. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: fix assert in bch2_btree_path_traverse_cached()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Fix error handling in btree_iter_peek_slotKent Overstreet
Fixes: 2a33d540b22c ("bcachefs: Don't peek key cache unless we have a real key") Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: can_use_btree_node()Kent Overstreet
Make sure btree_node_alloc() respects allocation policy when allocating from the btree node reserve. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: rereplicate flushes interior updatesKent Overstreet
We need to flush interior updates before gcing replicas entries, otherwise we might still see replicas entries from in flight btree updates. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: bch2_move_data() now walks btree nodesKent Overstreet
bch2_move_data_btree() can already walk btree nodes, and it properly handles btree roots. This is a code cleanup - and it fixes the rereplicate2 test, we can now reliably rerereplicate in one psas. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Ensure we don't return with closure on waitlistKent Overstreet
things will break wildly if we leave a stack allocated closure on a waitlist Reported-by: syzbot+0ea2c41a649240197795@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Fix unhandled key type in fiemap_fill_extentKent Overstreet
KEY_TYPE_error was unhandled; also add a warning for other unhandled key types. Reported-by: syzbot+397f6fe952a0defb9424@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: sysfs trigger_btree_write_buffer_flushKent Overstreet
Add a knob for torture testing write buffer flushing. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Don't emit empty journal entry for accountingKent Overstreet
Eliminate a bit of wasted space in the journal. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Add comment to journal_flush_done()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Kill redundant write_super() when running recovery passesKent Overstreet
write_super() is an expensive operation, and when we're doing extensive repair we may call btree_lost_data() or run_explicit_recovery_pass() quite frequently. Add a new helper, __test_and_set_bit_le64(), for tracking whether we did an update. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Tell wbt throttling not to throttle metadata writesKent Overstreet
blk-wbt.c skips throttling for REQ_SYNC|REQ_IDLE, but not REQ_META - !? Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Don't call bch2_recovery_pass_want_ratelimit without sb_lockKent Overstreet
Fix a locking bug - we need to look up the recovery_passes section of the superblock to check whether a recovery pass should be ratelimited. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: Fix padding zeroout when creating casefolded direntsKent Overstreet
Reported-by: syzbot+894877f2c4dd5fdea634@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: convert error.c to CLASS/guardsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 daysbcachefs: bch2_run_recovery_pass() now prints errorsKent Overstreet
With this the individual recovery passes no longer have to prin errors, and we can eliminate some gotos. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>