Age | Commit message (Collapse) | Author |
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Prep work for more CLASS() conversion.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
Flags should not be passed as bare integers.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
Once we have rcu_lock() we shouldn't reload c->snapshots.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
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>
|
|
Small optimization, calling into vsprintf() is heavy.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
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>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
Keep the log clean for harmless, expected errors.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
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>
|
|
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>
|
|
When we log an error, this makes sure they're printed correctly.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Simplify callers a bit, and make sure we're not squashing a transaction
restart error.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Fixes: 2a33d540b22c ("bcachefs: Don't peek key cache unless we have a real key")
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Make sure btree_node_alloc() respects allocation policy when allocating
from the btree node reserve.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Add a knob for torture testing write buffer flushing.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Eliminate a bit of wasted space in the journal.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
blk-wbt.c skips throttling for REQ_SYNC|REQ_IDLE, but not REQ_META - !?
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
Reported-by: syzbot+894877f2c4dd5fdea634@syzkaller.appspotmail.com
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|