Fix false-positive -EDOM checksum errors on overlapping unaligned reads #79
Closed
changwei.ye
wants to merge 1 commits from
changwei.ye/vitastor:fix-intent-write-corruption into master
pull from: changwei.ye/vitastor:fix-intent-write-corruption
merge into: vitalif:master
vitalif:master
vitalif:tombstones
vitalif:primary-stickiness
vitalif:libvfn
vitalif:canceling
vitalif:immediate-repeering
vitalif:rdma-close-tcp
vitalif:use-degraded-writes
vitalif:fix-write-delete-flow
vitalif:openssl-3.0.12
vitalif:openssl-capture-secrets
vitalif:ignore-small-rdma-end
vitalif:encrypt-batch
vitalif:faster-peering-calc
vitalif:http-hello
vitalif:xxh3-bench
vitalif:create-user-etcd-based
vitalif:aesxts_streaming_nosupport
vitalif:refactor-heap-continue-write
vitalif:ston3lu-patch-0127
vitalif:rdma-credits
vitalif:heap-meta
vitalif:sendmsg-zc-no-more-error
vitalif:fix-clear-refs
vitalif:veeam-trick
vitalif:test-etcd-schizo
vitalif:test
vitalif:test1
vitalif:test2
vitalif:cow-meta
vitalif:kv-readahead
vitalif:qemu-fix-crash-idea
vitalif:eventloop-auto-init-trigger
vitalif:hugo-docs
vitalif:node-mutex-and-postpone
vitalif:check-writeback
vitalif:msgr-iothreads-v2
vitalif:antietcd
vitalif:rel-1.4
vitalif:test-fix-ec-unknown-state-51
vitalif:kv-update
vitalif:kv-debug
vitalif:hotfix-1.2.0
vitalif:rdma-simple-nodp
vitalif:zerocopy-tcp-send
vitalif:csi-staging
vitalif:hotfix-1.1.0
vitalif:hotfix-1.0.0
vitalif:fsync-feedback
vitalif:cached-reads
vitalif:qemu-send-loop
vitalif:test-double-alloc
vitalif:hier-failure-domains
vitalif:mon-self-restart
vitalif:epoch-deletions
vitalif:rdma-flow-control
vitalif:csi-use-vitastor-cli
vitalif:rdma-v2
vitalif:etcd-hide-base64
vitalif:lrc-matrix
vitalif:rm-left-on-dead
vitalif:nfs-proxy-old
vitalif:non-odp-rdma
vitalif:test-zctr
vitalif:separate-data-connections
vitalif:sec_osd_msgr
vitalif:test-assert
vitalif:nbd-vmsplice
vitalif:allow-etcd-address-option
vitalif:rdma-zerocopy
vitalif:rel-0.5
vitalif:openonload
vitalif:sync-io-test
vitalif:trace-sync
vitalif:trace-sqes
vitalif:test-submit-and-wait
vitalif:test-sq-poll
vitalif:blocking-uring-test
1 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| 937337d228 |
Fix false-positive -EDOM checksum errors on overlapping unaligned reads
When csum_block_size > bitmap_granularity and perfect_csum_update = false (the default behavior), an unaligned INTENT_WRITE modifies the physical block directly in-place without recalculating and updating the large block's checksum. During a subsequent read that requires padding to the checksum block boundary (e.g., reading adjacent unaligned data), the read logic must skip checksum verification for the underlying BIG_WRITE because the physical data has been safely tampered with by the INTENT_WRITE. Previously, the need_skip logic in blockstore_read.cpp correctly identified and skipped the verification for overlapping SMALL_WRITEs but mistakenly omitted INTENT_WRITEs. This caused the padded read to verify the stale BIG_WRITE checksum against the newly modified physical data, leading to a fatal false-positive -EDOM (checksum mismatch) IO error on reads. This commit fixes the bug by ensuring BS_HEAP_INTENT_WRITE is evaluated alongside SMALL_WRITE to apply the COPY_BUF_SKIP_CSUM bypass during overlapping padded reads. A regression test case (test_intent_write_corruption) is also added to reproduce this specific data-layout scenario and verify the fix. |