linux/fs/bcachefs
Kent Overstreet 2da31af6e8 bcachefs: Fix BTREE_ITER_FILTER_SNAPSHOTS on inodes btree
commit 204f45140f upstream.

If we're in FILTER_SNAPSHOTS mode and we start scanning a range of the
keyspace where no keys are visible in the current snapshot, we have a
problem - we'll scan for a very long time before scanning terminates.

Awhile back, this was fixed for most cases with peek_upto() (and
assertions that enforce that it's being used).

But the fix missed the fact that the inodes btree is different - every
key offset is in a different snapshot tree, not just the inode field.

Fixes:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-26 18:18:50 -04:00
..
acl.c bcachefs: make RO snapshots actually RO 2024-01-01 11:47:07 -05:00
acl.h bcachefs: bch2_acl_to_text() 2023-10-22 17:10:12 -04:00
alloc_background.c bcachefs: use swab40 for bch_backpointer.bucket_offset bitfield 2023-11-04 22:19:13 -04:00
alloc_background.h bcachefs: Ensure copygc does not spin 2023-11-04 14:17:11 -04:00
alloc_foreground.c bcachefs: Fix bch2_alloc_sectors_start_trans() error handling 2023-12-19 19:01:52 -05:00
alloc_foreground.h bcachefs: sb-members.c 2023-10-22 17:10:10 -04:00
alloc_types.h bcachefs: Fix assorted checkpatch nits 2023-10-22 17:10:10 -04:00
backpointers.c bcachefs: Fix null ptr deref in bch2_backpointer_get_node() 2023-11-13 21:42:22 -05:00
backpointers.h bcachefs: use swab40 for bch_backpointer.bucket_offset bitfield 2023-11-04 22:19:13 -04:00
bbpos_types.h bcachefs: move: convert to bbpos 2023-10-31 12:18:37 -04:00
bbpos.h bcachefs: move: convert to bbpos 2023-10-31 12:18:37 -04:00
bcachefs_format.h bcachefs: bch_sb_field_downgrade 2024-01-01 11:47:07 -05:00
bcachefs_ioctl.h
bcachefs.h bcachefs: bch_sb.recovery_passes_required 2024-01-01 11:47:07 -05:00
bkey_buf.h
bkey_cmp.h
bkey_methods.c bcachefs: rebalance_work btree is not a snapshots btree 2023-11-04 22:19:13 -04:00
bkey_methods.h bcachefs: Enumerate fsck errors 2023-11-01 21:11:08 -04:00
bkey_sort.c bcachefs: bkey_copy() is no longer a macro 2023-11-05 13:12:18 -05:00
bkey_sort.h bcachefs: Array bounds fixes 2023-10-22 17:10:12 -04:00
bkey.c bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
bkey.h bcachefs: bkey_copy() is no longer a macro 2023-11-05 13:12:18 -05:00
bset.c bcachefs: Kill other unreachable() uses 2023-10-22 17:10:13 -04:00
bset.h
btree_cache.c bcachefs: Don't drop journal pins in exit path 2023-12-03 12:44:18 -05:00
btree_cache.h bcachefs: bch2_btree_id_str() 2023-10-31 12:18:37 -04:00
btree_gc.c bcachefs: Convert gc_alloc_start() to for_each_btree_key2() 2023-11-28 22:58:22 -05:00
btree_gc.h bcachefs: Split up btree_update_leaf.c 2023-10-22 17:10:10 -04:00
btree_io.c bcachefs: Don't drop journal pins in exit path 2023-12-03 12:44:18 -05:00
btree_io.h bcachefs: Don't drop journal pins in exit path 2023-12-03 12:44:18 -05:00
btree_iter.c bcachefs: Fix BTREE_ITER_FILTER_SNAPSHOTS on inodes btree 2024-03-26 18:18:50 -04:00
btree_iter.h bcachefs: fix invalid memory access in bch2_fs_alloc() error path 2023-12-14 15:24:14 -05:00
btree_journal_iter.c bcachefs: Proper refcounting for journal_keys 2023-11-24 02:43:12 -05:00
btree_journal_iter.h bcachefs: Proper refcounting for journal_keys 2023-11-24 02:43:12 -05:00
btree_key_cache_types.h bcachefs: Run btree key cache shrinker less aggressively 2023-11-13 21:45:01 -05:00
btree_key_cache.c bcachefs: Don't drop journal pins in exit path 2023-12-03 12:44:18 -05:00
btree_key_cache.h
btree_locking.c bcachefs: Ensure srcu lock is not held too long 2023-11-04 14:17:11 -04:00
btree_locking.h bcachefs: Don't downgrade locks on transaction restart 2023-11-01 21:11:08 -04:00
btree_trans_commit.c bcachefs: Kill journal pre-reservations 2023-11-14 23:44:43 -05:00
btree_types.h bcachefs: Don't decrease BTREE_ITER_MAX when LOCKDEP=y 2023-11-14 23:44:44 -05:00
btree_update_interior.c bcachefs; guard against overflow in btree node split 2023-12-19 16:18:16 -05:00
btree_update_interior.h bcachefs: btree_node_u64s_with_format() takes nr keys 2023-12-19 16:18:13 -05:00
btree_update.c bcachefs: Fix insufficient disk reservation with compression + snapshots 2023-12-21 23:46:51 -05:00
btree_update.h bcachefs: Remove duplicate include 2023-10-22 17:10:14 -04:00
btree_write_buffer_types.h
btree_write_buffer.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
btree_write_buffer.h
buckets_types.h
buckets_waiting_for_journal_types.h
buckets_waiting_for_journal.c bcachefs: Fix -Wformat in bch2_set_bucket_needs_journal_commit() 2023-10-22 17:10:13 -04:00
buckets_waiting_for_journal.h
buckets.c bcachefs: Fix bucket data type for stripe buckets 2023-11-28 17:18:24 -05:00
buckets.h bcachefs: All triggers are BTREE_TRIGGER_WANTS_OLD_AND_NEW 2023-10-31 12:18:37 -04:00
chardev.c bcachefs: install fd later to avoid race with close 2024-03-26 18:18:49 -04:00
chardev.h bcachefs: Fix assorted checkpatch nits 2023-10-22 17:10:10 -04:00
checksum.c bcachefs: bch2_sb_field_get() refactoring 2023-10-22 17:10:16 -04:00
checksum.h bcachefs: Fixes for building in userspace 2023-10-22 17:10:15 -04:00
clock_types.h
clock.c bcachefs: bch2_kthread_io_clock_wait() no longer sleeps until full amount 2024-02-16 19:14:30 +01:00
clock.h
compress.c bcachefs: Fix zstd compress workspace size 2023-11-28 17:18:24 -05:00
compress.h bcachefs: rebalance_work 2023-11-01 21:11:05 -04:00
counters.c bcachefs: bch2_sb_field_get() refactoring 2023-10-22 17:10:16 -04:00
counters.h
darray.c bcachefs: DARRAY_PREALLOCATED() 2024-01-01 11:46:52 -05:00
darray.h bcachefs: DARRAY_PREALLOCATED() 2024-01-01 11:46:52 -05:00
data_update.c bcachefs: Fix promotes 2023-12-26 19:31:11 -05:00
data_update.h bcachefs: Data update path won't accidentaly grow replicas 2023-11-25 21:48:42 -05:00
debug.c bcachefs: bch2_btree_id_str() 2023-10-31 12:18:37 -04:00
debug.h
dirent.c bcachefs: Fix deleted inode check for dirs 2023-12-08 00:39:56 -05:00
dirent.h bcachefs: Fix deleted inode check for dirs 2023-12-08 00:39:56 -05:00
disk_groups_types.h bcachefs: bch2_disk_path_to_text() no longer takes sb_lock 2023-10-31 12:18:37 -04:00
disk_groups.c bcachefs: Fix potential sleeping during mount 2023-11-14 23:44:43 -05:00
disk_groups.h bcachefs: bch2_disk_path_to_text() no longer takes sb_lock 2023-10-31 12:18:37 -04:00
ec_types.h
ec.c bcachefs: Guard against insufficient devices to create stripes 2023-11-13 21:42:22 -05:00
ec.h bcachefs: bch2_ec_read_extent() now takes btree_trans 2023-11-05 13:13:57 -05:00
errcode.c bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
errcode.h bcachefs: check for failure to downgrade 2024-03-26 18:18:50 -04:00
error.c bcachefs: bch_sb.recovery_passes_required 2024-01-01 11:47:07 -05:00
error.h bcachefs: fix BCH_FSCK_ERR enum 2023-12-19 19:01:52 -05:00
extent_update.c
extent_update.h
extents_types.h
extents.c bcachefs: rebalance shouldn't attempt to compress unwritten extents 2023-12-06 17:43:21 -05:00
extents.h bcachefs: Enumerate fsck errors 2023-11-01 21:11:08 -04:00
eytzinger.h
fifo.h
fs-common.c bcachefs: x-macro-ify inode flags enum 2023-11-05 13:12:18 -05:00
fs-common.h
fs-io-buffered.c bcachefs: allow writeback to fill bio completely 2023-11-04 22:19:13 -04:00
fs-io-buffered.h bcachefs: Split up fs-io.[ch] 2023-10-22 17:10:10 -04:00
fs-io-direct.c bcachefs: fix invalid free in dio write path 2024-01-01 11:43:03 -05:00
fs-io-direct.h bcachefs: Split up fs-io.[ch] 2023-10-22 17:10:10 -04:00
fs-io-pagecache.c bcachefs: Use correct fgf_t type as function argument 2023-11-13 21:42:21 -05:00
fs-io-pagecache.h bcachefs: Use correct fgf_t type as function argument 2023-11-13 21:42:21 -05:00
fs-io.c bcachefs: fix incorrect usage of REQ_OP_FLUSH 2024-02-16 19:14:31 +01:00
fs-io.h bcachefs: New io_misc.c helpers 2023-10-22 17:10:12 -04:00
fs-ioctl.c bcachefs: unlock parent dir if entry is not found in subvolume deletion 2024-02-16 19:14:31 +01:00
fs-ioctl.h bcachefs: x-macro-ify inode flags enum 2023-11-05 13:12:18 -05:00
fs.c bcachefs: make RO snapshots actually RO 2024-01-01 11:47:07 -05:00
fs.h bcachefs: Fixes for building in userspace 2023-10-22 17:10:15 -04:00
fsck.c bcachefs: Fix bch2_check_nlinks() for snapshots 2023-11-14 23:44:44 -05:00
fsck.h bcachefs: Check for too-large encoded extents 2023-10-31 12:18:37 -04:00
inode.c bcachefs: Fix deleted inode check for dirs 2023-12-08 00:39:56 -05:00
inode.h bcachefs: x-macro-ify inode flags enum 2023-11-05 13:12:18 -05:00
io_misc.c bcachefs: Fix an integer overflow 2023-11-01 21:11:08 -04:00
io_misc.h bcachefs: Fix an integer overflow 2023-11-01 21:11:08 -04:00
io_read.c bcachefs: Data update path won't accidentaly grow replicas 2023-11-25 21:48:42 -05:00
io_read.h bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
io_write_types.h bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
io_write.c bcachefs: fix buffer overflow in nocow write path 2024-01-01 11:46:52 -05:00
io_write.h closures: CLOSURE_CALLBACK() to fix type punning 2023-11-24 00:29:58 -05:00
journal_io.c bcachefs: fix incorrect usage of REQ_OP_FLUSH 2024-02-16 19:14:31 +01:00
journal_io.h closures: CLOSURE_CALLBACK() to fix type punning 2023-11-24 00:29:58 -05:00
journal_reclaim.c bcachefs: Close journal entry if necessary when flushing all pins 2023-12-10 16:53:46 -05:00
journal_reclaim.h bcachefs: refactor pin put helpers 2023-10-22 17:10:14 -04:00
journal_sb.c bcachefs: bch2_sb_field_get() refactoring 2023-10-22 17:10:16 -04:00
journal_sb.h
journal_seq_blacklist.c bcachefs: bch2_sb_field_get() refactoring 2023-10-22 17:10:16 -04:00
journal_seq_blacklist.h
journal_types.h bcachefs: Kill journal pre-reservations 2023-11-14 23:44:43 -05:00
journal.c bcachefs: Close journal entry if necessary when flushing all pins 2023-12-10 16:53:46 -05:00
journal.h bcachefs: Close journal entry if necessary when flushing all pins 2023-12-10 16:53:46 -05:00
Kconfig bcachefs: Put erasure coding behind an EXPERIMENTAL kconfig option 2023-11-24 00:29:58 -05:00
keylist_types.h
keylist.c
keylist.h
logged_ops.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
logged_ops.h bcachefs: Log finsert/fcollapse operations 2023-10-22 17:10:12 -04:00
lru.c bcachefs: Enumerate fsck errors 2023-11-01 21:11:08 -04:00
lru.h bcachefs: Enumerate fsck errors 2023-11-01 21:11:08 -04:00
Makefile bcachefs: bch_sb_field_downgrade 2024-01-01 11:47:07 -05:00
mean_and_variance_test.c
mean_and_variance.c
mean_and_variance.h bcachefs: Fix build on parisc by avoiding __multi3() 2024-03-26 18:18:49 -04:00
migrate.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
migrate.h
move_types.h bcachefs: move: move_stats refactoring 2023-10-31 12:18:38 -04:00
move.c bcachefs: rebalance should wakeup on shutdown if disabled 2024-02-16 19:14:30 +01:00
move.h bcachefs: rebalance should wakeup on shutdown if disabled 2024-02-16 19:14:30 +01:00
movinggc.c bcachefs: Extra kthread_should_stop() calls for copygc 2023-11-28 22:58:23 -05:00
movinggc.h
nocow_locking_types.h
nocow_locking.c bcachefs: More assertions for nocow locking 2023-10-22 17:10:15 -04:00
nocow_locking.h bcachefs: More assertions for nocow locking 2023-10-22 17:10:15 -04:00
opts.c bcachefs: Replace ERANGE with private error codes 2023-11-05 13:12:18 -05:00
opts.h bcachefs: Add IO error counts to bch_member 2023-11-01 21:11:08 -04:00
printbuf.c bcachefs: prt_bitflags_vector() 2024-01-01 11:47:07 -05:00
printbuf.h bcachefs: prt_bitflags_vector() 2024-01-01 11:47:07 -05:00
quota_types.h
quota.c bcachefs: Enumerate fsck errors 2023-11-01 21:11:08 -04:00
quota.h bcachefs: Enumerate fsck errors 2023-11-01 21:11:08 -04:00
rebalance_types.h bcachefs: rebalance_work 2023-11-01 21:11:05 -04:00
rebalance.c bcachefs: Add missing bch2_moving_ctxt_flush_all() 2024-02-16 19:14:30 +01:00
rebalance.h bcachefs: rebalance_work 2023-11-01 21:11:05 -04:00
recovery_types.h bcachefs: Add persistent identifiers for recovery passes 2024-01-01 11:47:07 -05:00
recovery.c bcachefs: bch_sb_field_downgrade 2024-01-01 11:47:07 -05:00
recovery.h bcachefs: Add persistent identifiers for recovery passes 2024-01-01 11:47:07 -05:00
reflink.c bcachefs: Don't run indirect extent trigger unless inserting/deleting 2023-12-04 16:04:55 -05:00
reflink.h bcachefs: Enumerate fsck errors 2023-11-01 21:11:08 -04:00
replicas_types.h
replicas.c bcachefs: Don't pass memcmp() as a pointer 2024-02-16 19:14:30 +01:00
replicas.h bcachefs: Add missing validation for jset_entry_data_usage 2023-11-28 17:18:24 -05:00
sb-clean.c bcachefs: bch_sb_field_downgrade 2024-01-01 11:47:07 -05:00
sb-clean.h bcachefs: sb-clean.c 2023-10-22 17:10:10 -04:00
sb-downgrade.c bcachefs: bch_sb_field_downgrade 2024-01-01 11:47:07 -05:00
sb-downgrade.h bcachefs: bch_sb_field_downgrade 2024-01-01 11:47:07 -05:00
sb-errors_types.h bcachefs: move BCH_SB_ERRS() to sb-errors_types.h 2024-01-01 11:47:07 -05:00
sb-errors.c bcachefs: bch_sb_field_downgrade 2024-01-01 11:47:07 -05:00
sb-errors.h bcachefs: bch_sb.recovery_passes_required 2024-01-01 11:47:07 -05:00
sb-members.c bcachefs: Move __bch2_members_v2_get_mut to sb-members.h 2023-11-05 13:12:17 -05:00
sb-members.h bcachefs: Move __bch2_members_v2_get_mut to sb-members.h 2023-11-05 13:12:17 -05:00
seqmutex.h
siphash.c
siphash.h
six.c bcachefs: six locks: Fix lost wakeup 2023-11-14 23:44:44 -05:00
six.h
snapshot.c bcachefs: kvfree bch_fs::snapshots in bch2_fs_snapshots_exit 2024-02-16 19:14:31 +01:00
snapshot.h bcachefs: Enumerate fsck errors 2023-11-01 21:11:08 -04:00
str_hash.h
subvolume_types.h bcachefs: Use DECLARE_FLEX_ARRAY() helper and fix multiple -Warray-bounds warnings 2023-11-13 21:42:21 -05:00
subvolume.c bcachefs: make RO snapshots actually RO 2024-01-01 11:47:07 -05:00
subvolume.h bcachefs: make RO snapshots actually RO 2024-01-01 11:47:07 -05:00
super_types.h bcachefs: preserve device path as device name 2023-11-24 02:42:07 -05:00
super-io.c bcachefs: fix simulateously upgrading & downgrading 2024-03-26 18:18:50 -04:00
super-io.h bcachefs: bch_sb_field_downgrade 2024-01-01 11:47:07 -05:00
super.c bcachefs: improve modprobe support by providing softdeps 2023-12-14 15:24:14 -05:00
super.h bcachefs: sb-members.c 2023-10-22 17:10:10 -04:00
sysfs.c bcachefs: Convert compression_stats to for_each_btree_key2 2023-12-04 16:04:55 -05:00
sysfs.h
tests.c bcachefs: bch_err_msg(), bch_err_fn() now filters out transaction restart errors 2023-10-22 17:10:15 -04:00
tests.h
trace.c bcachefs: move: move_stats refactoring 2023-10-31 12:18:38 -04:00
trace.h bcachefs: trace_move_extent_start_fail() now includes errcode 2023-11-28 17:18:24 -05:00
two_state_shared_lock.c
two_state_shared_lock.h
util.c bcachefs: time_stats: Check for last_event == 0 when updating freq stats 2024-02-16 19:14:31 +01:00
util.h bcachefs: prt_bitflags_vector() 2024-01-01 11:47:07 -05:00
varint.c bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
varint.h
vstructs.h bcachefs: Array bounds fixes 2023-10-22 17:10:12 -04:00
xattr.c bcachefs: make RO snapshots actually RO 2024-01-01 11:47:07 -05:00
xattr.h bcachefs: Enumerate fsck errors 2023-11-01 21:11:08 -04:00