summaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)Author
11 hoursfixup! bcachefs: CLASS(btree_iter)bcachefs-testingKent Overstreet
11 hoursbcachefs: btree_id_is_extents_snapshotsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 hoursbcachefs: BTREE_ITER_nofilter_whiteoutsKent Overstreet
Add a flag to tell btree_iter_peek() to return whiteouts that we find, even though we're filtering out keys in unrelated snapshots. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 hoursbcachefs: bch2_set_version_incompat() no longer takes sb_lock unless writing sbKent Overstreet
We're going to be using this in bch2_trans_update_extent(), so it needs some optimizing. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 hoursovl: support layers on case-folding capable filesystemsAmir Goldstein
Case folding is often applied to subtrees and not on an entire filesystem. Disallowing layers from filesystems that support case folding is over limiting. Replace the rule that case-folding capable are not allowed as layers with a rule that case folded directories are not allowed in a merged directory stack. Should case folding be enabled on an underlying directory while overlayfs is mounted the outcome is generally undefined. Specifically in ovl_lookup(), we check the base underlying directory and fail with -ESTALE and write a warning to kmsg if an underlying directory case folding is enabled. Suggested-by: Kent Overstreet <kent.overstreet@linux.dev> Link: https://lore.kernel.org/linux-fsdevel/20250520051600.1903319-1-kent.overstreet@linux.dev/ Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 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>
11 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>
11 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>
11 hoursbcachefs: Convert bch2_bkey_get_mut() to CLASS(btree_iter)for-nextKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 hoursbcachefs: __bch2_bkey_get_val_typed() uses CLASS(btree_iter)Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 hoursbcachefs: Kill bch2_bkey_get_iter_typed()Kent Overstreet
More CLASS() conversion. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 hoursbcachefs: for_each_btree_key_norestart() uses CLASS(btree_iter)Kent Overstreet
Kill a bunch of bch2_trans_iter_exit() calls. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 hoursbcachefs: Kill most bch2_bkey_get_iter() usesKent Overstreet
CLASS(btree_iter, ...); peek_slot() is now more concise. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 hoursbcachefs: CLASS(btree_iter)Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
28 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>
28 hoursbcachefs: kill trans arg to bch2_trans_iter_exit()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
28 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>
28 hoursbcachefs: More enum conversionKent Overstreet
Flags should not be passed as bare integers. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
28 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>
7 daysbcachefs: Add missing error_throw to bch2_set_version_incompat()bcachefs-2025-07-28Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 daysbcachefs: Hook up progress indicators for most recovery passesKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 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>
7 daysbcachefs: Add pass_done to recovery_pass_status_to_text()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 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>
7 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>
7 daysbcachefs: Ensure pick_read_device() returns error for btree pointersKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 daysbcachefs: Clean up btree_node_read_work() error handlingKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 daysbcachefs: log devices we're scanning in btree node scanKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 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>
7 daysbcachefs: fix assert in bch2_btree_path_traverse_cached()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>