linux-stable/fs/bcachefs
Brian Foster 3c40841cdc bcachefs: fix crc32c checksum merge byte order problem
An fsstress task on a big endian system (s390x) quickly produces a
bunch of CRC errors in the system logs. Most of these are related to
the narrow CRCs path, but the fundamental problem can be reduced to
a single write and re-read (after dropping caches) of a previously
merged extent.

The key merge path that handles extent merges eventually calls into
bch2_checksum_merge() to combine the CRCs of the associated extents.
This code attempts to avoid a byte order swap by feeding the le64
values into the crc32c code, but the latter casts the resulting u64
value down to a u32, which truncates the high bytes where the actual
crc value ends up. This results in a CRC value that does not change
(since it is merged with a CRC of 0), and checksum failures ensue.

Fix the checksum merge code to swap to cpu byte order on the
boundaries to the external crc code such that any value casting is
handled properly.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:10:15 -04:00
..
acl.c bcachefs: acl: Add missing check in bch2_acl_chmod() 2023-10-22 17:10:14 -04:00
acl.h bcachefs: bch2_acl_to_text() 2023-10-22 17:10:12 -04:00
alloc_background.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
alloc_background.h bcachefs: Kill bch2_bucket_gens_read() 2023-10-22 17:10:06 -04:00
alloc_foreground.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04: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 a null ptr deref in bch2_get_alloc_in_memory_pos() 2023-10-22 17:10:15 -04:00
backpointers.h bcachefs: remove duplicate code between backpointer update paths 2023-10-22 17:10:08 -04:00
bbpos.h bcachefs: Run bch2_check_backpointers_to_extents() in multiple passes if necessary 2023-10-22 17:09:51 -04:00
bcachefs.h bcachefs: bch_err_msg(), bch_err_fn() now filters out transaction restart errors 2023-10-22 17:10:15 -04:00
bcachefs_format.h bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
bcachefs_ioctl.h bcachefs: Convert to __packed and __aligned 2023-10-22 17:09:45 -04:00
bkey.c bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
bkey.h bcachefs: Array bounds fixes 2023-10-22 17:10:12 -04:00
bkey_buf.h bcachefs: Move bkey bkey_unpack_key() to bkey.h 2023-10-22 17:09:45 -04:00
bkey_cmp.h bcachefs: bch2_bkey_cmp_packed_inlined() 2023-10-22 17:09:45 -04:00
bkey_methods.c bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
bkey_methods.h bcachefs: BCH_COMPAT_bformat_overflow_done no longer required 2023-10-22 17:10:09 -04:00
bkey_sort.c bcachefs: Use memcpy_u64s_small() for copying keys 2023-10-22 17:10:01 -04:00
bkey_sort.h bcachefs: Array bounds fixes 2023-10-22 17:10:12 -04:00
bset.c bcachefs: Kill other unreachable() uses 2023-10-22 17:10:13 -04:00
bset.h bcachefs: bch2_btree_node_to_text() const correctness 2023-10-22 17:09:56 -04:00
btree_cache.c bcachefs: Minor bch2_btree_node_get() smatch fixes 2023-10-22 17:10:14 -04:00
btree_cache.h bcachefs: Assorted sparse fixes 2023-10-22 17:10:06 -04:00
btree_gc.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
btree_gc.h bcachefs: Split up btree_update_leaf.c 2023-10-22 17:10:10 -04:00
btree_io.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
btree_io.h bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
btree_iter.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
btree_iter.h bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
btree_journal_iter.c bcachefs: btree_journal_iter.c 2023-10-22 17:10:10 -04:00
btree_journal_iter.h bcachefs: btree_journal_iter.c 2023-10-22 17:10:10 -04:00
btree_key_cache.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
btree_key_cache.h bcachefs: don't bump key cache journal seq on nojournal commits 2023-10-22 17:09:56 -04:00
btree_locking.c bcachefs: Assorted fixes for clang 2023-10-22 17:10:09 -04:00
btree_locking.h bcachefs: Fix silent enum conversion error 2023-10-22 17:10:12 -04:00
btree_trans_commit.c bcachefs: Always check for invalid bkeys in main commit path 2023-10-22 17:10:15 -04:00
btree_types.h bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
btree_update.c bcachefs: More minor smatch fixes 2023-10-22 17:10:14 -04:00
btree_update.h bcachefs: Remove duplicate include 2023-10-22 17:10:14 -04:00
btree_update_interior.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
btree_update_interior.h bcachefs: Move some declarations to the correct header 2023-10-22 17:10:08 -04:00
btree_write_buffer.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
btree_write_buffer.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
btree_write_buffer_types.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
buckets.c bcachefs: Fix an overflow check 2023-10-22 17:10:14 -04:00
buckets.h bcachefs: Change bucket_lock() to use bit_spin_lock() 2023-10-22 17:10:14 -04:00
buckets_types.h bcachefs: Fragmentation LRU 2023-10-22 17:09:53 -04:00
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 bcachefs: New data structure for buckets waiting on journal commit 2023-10-22 17:09:22 -04:00
buckets_waiting_for_journal_types.h bcachefs: New data structure for buckets waiting on journal commit 2023-10-22 17:09:22 -04:00
chardev.c bcachefs: Fix strndup_user() error checking 2023-10-22 17:10:14 -04:00
chardev.h bcachefs: Fix assorted checkpatch nits 2023-10-22 17:10:10 -04:00
checksum.c bcachefs: fix crc32c checksum merge byte order problem 2023-10-22 17:10:15 -04:00
checksum.h bcachefs: Fixes for building in userspace 2023-10-22 17:10:15 -04:00
clock.c bcachefs: Private error codes: ENOMEM 2023-10-22 17:09:57 -04:00
clock.h bcachefs: Convert various code to printbuf 2023-10-22 17:08:43 -04:00
clock_types.h bcachefs: Persist 64 bit io clocks 2023-10-22 17:08:52 -04:00
compress.c bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
compress.h bcachefs: Compression levels 2023-10-22 17:10:07 -04:00
counters.c bcachefs: Remove unneeded semicolon 2023-10-22 17:10:13 -04:00
counters.h bcachefs: Add persistent counters 2023-10-22 17:09:32 -04:00
darray.h bcachefs: Assorted fixes for clang 2023-10-22 17:10:09 -04:00
data_update.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
data_update.h bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
debug.c bcachefs: Fix copy_to_user() usage in flush_buf() 2023-10-22 17:10:14 -04:00
debug.h bcachefs: bch2_btree_node_ondisk_to_text() 2023-10-22 17:09:56 -04:00
dirent.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
dirent.h bcachefs: Introduce bch2_dirent_get_name 2023-10-22 17:10:10 -04:00
disk_groups.c bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
disk_groups.h bcachefs: bch_opt_fn 2023-10-22 17:10:07 -04:00
ec.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
ec.h bcachefs: Kill other unreachable() uses 2023-10-22 17:10:13 -04:00
ec_types.h bcachefs: Simplify ec stripes heap 2023-10-22 17:09:54 -04:00
errcode.c bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
errcode.h bcachefs: More minor smatch fixes 2023-10-22 17:10:14 -04:00
error.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
error.h bcachefs: fix_errors option is now a proper enum 2023-10-22 17:10:07 -04:00
extent_update.c bcachefs: Use for_each_btree_key_upto() more consistently 2023-10-22 17:09:50 -04:00
extent_update.h bcachefs: Reduce iter->trans usage 2023-10-22 17:09:10 -04:00
extents.c bcachefs: Fix 'pointer to invalid device' check 2023-10-22 17:10:11 -04:00
extents.h bcachefs: Change check for invalid key types 2023-10-22 17:10:06 -04:00
extents_types.h
eytzinger.h bcachefs: Make eytzinger size parameter more conventional 2023-10-22 17:09:21 -04:00
fifo.h bcachefs: More style fixes 2023-10-22 17:09:45 -04:00
fs-common.c bcachefs: Convert -ENOENT to private error codes 2023-10-22 17:10:03 -04:00
fs-common.h bcachefs: Add BCH_SUBVOLUME_UNLINKED 2023-10-22 17:09:15 -04:00
fs-io-buffered.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10: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: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
fs-io-direct.h bcachefs: Split up fs-io.[ch] 2023-10-22 17:10:10 -04:00
fs-io-pagecache.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
fs-io-pagecache.h bcachefs: Split up fs-io.[ch] 2023-10-22 17:10:10 -04:00
fs-io.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
fs-io.h bcachefs: New io_misc.c helpers 2023-10-22 17:10:12 -04:00
fs-ioctl.c bcachefs: fs-ioctl: Fix copy_to_user() error code 2023-10-22 17:10:14 -04:00
fs-ioctl.h bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
fs.c bcachefs: initial freeze/unfreeze support 2023-10-22 17:10:15 -04:00
fs.h bcachefs: Fixes for building in userspace 2023-10-22 17:10:15 -04:00
fsck.c bcachefs: bch_err_msg(), bch_err_fn() now filters out transaction restart errors 2023-10-22 17:10:15 -04:00
fsck.h bcachefs: Enumerate recovery passes 2023-10-22 17:10:06 -04:00
inode.c bcachefs: Fix bch2_inode_delete_keys() 2023-10-22 17:10:15 -04:00
inode.h bcachefs: Kill missing inode warnings in bch2_quota_read() 2023-10-22 17:10:12 -04:00
io_misc.c bcachefs: Fix -Wself-assign 2023-10-22 17:10:14 -04:00
io_misc.h bcachefs: Log finsert/fcollapse operations 2023-10-22 17:10:12 -04:00
io_read.c bcachefs: Fixes for building in userspace 2023-10-22 17:10:15 -04:00
io_read.h bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
io_write.c bcachefs: nocow locking: Fix lock leak 2023-10-22 17:10:15 -04:00
io_write.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
journal.c bcachefs: fix race between journal entry close and pin set 2023-10-22 17:10:14 -04:00
journal.h bcachefs: fix race between journal entry close and pin set 2023-10-22 17:10:14 -04:00
journal_io.c bcachefs: drop journal lock before calling journal_write 2023-10-22 17:10:14 -04:00
journal_io.h bcachefs: Convert journal validation to bkey_invalid_flags 2023-10-22 17:10:10 -04:00
journal_reclaim.c bcachefs: refactor pin put helpers 2023-10-22 17:10:14 -04:00
journal_reclaim.h bcachefs: refactor pin put helpers 2023-10-22 17:10:14 -04:00
journal_sb.c bcachefs: Assorted sparse fixes 2023-10-22 17:10:06 -04:00
journal_sb.h bcachefs: Journal resize fixes 2023-10-22 17:09:56 -04:00
journal_seq_blacklist.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
journal_seq_blacklist.h Revert "bcachefs: Delete some obsolete journal_seq_blacklist code" 2023-10-22 17:09:21 -04:00
journal_types.h bcachefs: Kill JOURNAL_WATERMARK 2023-10-22 17:10:05 -04:00
Kconfig bcachefs: Compression levels 2023-10-22 17:10:07 -04:00
keylist.c bcachefs: GFP_NOIO -> GFP_NOFS 2023-10-22 17:10:03 -04:00
keylist.h bcachefs: Kill bch2_keylist_add_in_order() 2023-10-22 17:09:54 -04:00
keylist_types.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: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
lru.h bcachefs: bch2_btree_bit_mod() 2023-10-22 17:10:08 -04:00
Makefile bcachefs: BTREE_ID_logged_ops 2023-10-22 17:10:12 -04:00
mean_and_variance.c bcachefs: Mean and variance 2023-10-22 17:09:43 -04:00
mean_and_variance.h mean and variance: Add a missing include 2023-10-22 17:10:02 -04:00
mean_and_variance_test.c mean and variance: More tests 2023-10-22 17:10:02 -04:00
migrate.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
migrate.h
move.c bcachefs: More minor smatch fixes 2023-10-22 17:10:14 -04:00
move.h bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
move_types.h bcachefs: Rhashtable based buckets_in_flight for copygc 2023-10-22 17:09:58 -04:00
movinggc.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
movinggc.h bcachefs: bch2_copygc_wait_to_text() 2023-10-22 17:09:55 -04:00
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
nocow_locking_types.h bcachefs: Improved nocow locking 2023-10-22 17:09:52 -04:00
opts.c bcachefs: Ignore unknown mount options 2023-10-22 17:10:15 -04:00
opts.h bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
printbuf.c bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
printbuf.h bcachefs: Improve dev_alloc_debug_to_text() 2023-10-22 17:09:55 -04:00
quota.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
quota.h bcachefs: Change check for invalid key types 2023-10-22 17:10:06 -04:00
quota_types.h
rebalance.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
rebalance.h bcachefs: Convert various code to printbuf 2023-10-22 17:08:43 -04:00
rebalance_types.h bcachefs: add progress stats to sysfs 2023-10-22 17:09:10 -04:00
recovery.c bcachefs: Make btree root read errors recoverable 2023-10-22 17:10:15 -04:00
recovery.h bcachefs: btree_journal_iter.c 2023-10-22 17:10:10 -04:00
recovery_types.h bcachefs: BTREE_ID_logged_ops 2023-10-22 17:10:12 -04:00
reflink.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
reflink.h bcachefs: Change check for invalid key types 2023-10-22 17:10:06 -04:00
replicas.c bcachefs: Convert more code to bch_err_msg() 2023-10-22 17:10:12 -04:00
replicas.h bcachefs: Fix bch2_trans_reset_updates() 2023-10-22 17:09:50 -04:00
replicas_types.h bcachefs: Fix bch2_trans_reset_updates() 2023-10-22 17:09:50 -04:00
sb-clean.c bcachefs: sb-clean.c 2023-10-22 17:10:10 -04:00
sb-clean.h bcachefs: sb-clean.c 2023-10-22 17:10:10 -04:00
sb-members.c bcachefs: sb-members.c 2023-10-22 17:10:10 -04:00
sb-members.h bcachefs: sb-members.c 2023-10-22 17:10:10 -04:00
seqmutex.h bcachefs: seqmutex; fix a lockdep splat 2023-10-22 17:10:04 -04:00
siphash.c bcachefs: Assorted checkpatch fixes 2023-10-22 17:09:44 -04:00
siphash.h
six.c bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
six.h six locks: Split out seq, use atomic_t instead of atomic64_t 2023-10-22 17:10:02 -04:00
snapshot.c bcachefs: Fix looping around bch2_propagate_key_to_snapshot_leaves() 2023-10-22 17:10:15 -04:00
snapshot.h bcachefs: Make sure to initialize equiv when creating new snapshots 2023-10-22 17:10:15 -04:00
str_hash.h bcachefs: Convert -ENOENT to private error codes 2023-10-22 17:10:03 -04:00
subvolume.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
subvolume.h bcachefs: Fix -Wincompatible-function-pointer-types-strict from key_invalid callbacks 2023-10-22 17:10:13 -04:00
subvolume_types.h bcachefs: is_ancestor bitmap 2023-10-22 17:10:07 -04:00
super-io.c bcachefs: Fixes for building in userspace 2023-10-22 17:10:15 -04:00
super-io.h bcachefs: sb-clean.c 2023-10-22 17:10:10 -04:00
super.c bcachefs: More assertions for nocow locking 2023-10-22 17:10:15 -04:00
super.h bcachefs: sb-members.c 2023-10-22 17:10:10 -04:00
super_types.h bcachefs: Fix bch_sb_handle type 2023-10-22 17:10:12 -04:00
sysfs.c bcachefs: Fix changing durability using sysfs 2023-10-22 17:10:15 -04:00
sysfs.h bcachefs: Add persistent counters 2023-10-22 17:09:32 -04:00
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 bcachefs: Add error handling to unit & perf tests 2023-10-22 17:08:48 -04:00
trace.c bcachefs: Improve trans_restart_split_race tracepoint 2023-10-22 17:09:58 -04:00
trace.h bcachefs: trace_read_nopromote() 2023-10-22 17:10:12 -04:00
two_state_shared_lock.c bcachefs: Inline bch2_two_state_(trylock|unlock) 2023-10-22 17:09:51 -04:00
two_state_shared_lock.h bcachefs: Inline bch2_two_state_(trylock|unlock) 2023-10-22 17:09:51 -04:00
util.c bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
util.h bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
varint.c bcachefs: Fix W=12 build errors 2023-10-22 17:10:13 -04:00
varint.h bcachefs: Add safe versions of varint encode/decode 2023-10-22 17:09:08 -04:00
vstructs.h bcachefs: Array bounds fixes 2023-10-22 17:10:12 -04:00
xattr.c bcachefs: Heap allocate btree_trans 2023-10-22 17:10:13 -04:00
xattr.h bcachefs: bch2_xattr_set() now updates ctime 2023-10-22 17:10:06 -04:00