Repository navigation
block, nfsd: fixes for sub-sector bvec direct I/O - #1272
blktests-ci-kpd[bot] wants to merge 1 commit into
Conversation
|
Upstream branch: 28924df |
4ddd216 to
00cc4ca
Compare
|
Upstream branch: 893e117 |
f4d8902 to
8013db8
Compare
00cc4ca to
7efd8cd
Compare
|
Upstream branch: 50d05c7 |
8013db8 to
096d4de
Compare
7efd8cd to
a0aeca9
Compare
|
Upstream branch: 5225b8e |
096d4de to
6cb2bc5
Compare
a0aeca9 to
772381e
Compare
|
Upstream branch: 2f0c1cf |
6cb2bc5 to
9659271
Compare
772381e to
0224dee
Compare
|
Upstream branch: 2f0c1cf |
9659271 to
79c5eae
Compare
0224dee to
f14340f
Compare
|
Upstream branch: 5878583 |
79c5eae to
f8453da
Compare
f14340f to
0e174bc
Compare
|
Upstream branch: 4982d35 |
f8453da to
6c9a7ea
Compare
0e174bc to
fbef20f
Compare
|
Upstream branch: 5dd1818 |
6c9a7ea to
899bbab
Compare
fbef20f to
4a650fc
Compare
|
Upstream branch: 72d3fcf |
0967633 to
34450ca
Compare
c6537fe to
eebb5bc
Compare
|
Upstream branch: 551c722 |
34450ca to
5218bde
Compare
eebb5bc to
bbd3af0
Compare
|
Upstream branch: ce1e022 |
5218bde to
960638f
Compare
bbd3af0 to
a9c0b46
Compare
|
Upstream branch: e767a4e |
960638f to
5aaded0
Compare
a9c0b46 to
72d0f5e
Compare
|
Upstream branch: a74306e |
5aaded0 to
26d3808
Compare
72d0f5e to
d980ad5
Compare
|
Upstream branch: None |
26d3808 to
aefaac0
Compare
d980ad5 to
83b99cc
Compare
|
Upstream branch: 22430ae |
aefaac0 to
36093b4
Compare
83b99cc to
9081535
Compare
|
Upstream branch: 69f80fe |
36093b4 to
347900b
Compare
brd_rw_bvec() takes the device position from bio->bi_iter.bi_sector, which bio_advance_iter_single() advances by bytes >> SECTOR_SHIFT. For a bvec whose length is not a multiple of the sector size the sector cursor silently loses the sub-sector residue while the data cursor (bi_bvec_done/bi_size) consumes the full length -- from that segment on, data is written at a device offset short of where it belongs, and every subsequent byte lands shifted with no error reported anywhere. Such bvec geometry is legal at the submitter: ITER_BVEC direct I/O passes the caller's bio_vec array through as-is (bio_iov_bvec_set()), so e.g. NFSD's NFSD_IO_DIRECT write path hands XFS/iomap a payload whose first fragment starts mid-page (the RPC header precedes it in the receive buffer) and whose fragment lengths are not sector multiples. A 1 MiB write arriving as bv0=(160,16224) + 63x(0,16384) + (0,160) reproduces on brd as: first 15872 = ALIGN_DOWN(16224, 512) bytes correct, everything after shifted forward by 352 = 16224 - 15872 bytes -- while the write completes successfully. Any NFSD_IO_DIRECT (or other kernel bvec direct I/O) write to a brd-backed filesystem is exposed; request-based drivers are unaffected because nothing in the request path does per-bvec sector arithmetic. Track the device position as a byte offset owned by the submit loop and advanced by the number of bytes each segment actually processed, instead of re-deriving it from the skewed bi_sector. Verified with a synthetic-bio reproducer over brd directly and through nvme-loop: mid-page-offset geometries and the page-aligned control now all read back byte-identical, and 20 fresh NFS connections x 16 MiB of O_DIRECT writes over an XFS-on-nvme-loop-on-brd export complete with zero data mismatches (previously most connections corrupted). Fixes: 3185444 ("brd: split I/O at page boundaries") Assisted-by: Claude:claude-fable-5 Signed-off-by: Mike Snitzer <snitzer@kernel.org>
|
Upstream branch: 7b63ef2 |
347900b to
87c6ebf
Compare
|
At least one diff in series https://patchwork.kernel.org/series/1160666/ irrelevant now for [{'archived': False, 'project': 241}] search patterns |
Pull request for series with
subject: block, nfsd: fixes for sub-sector bvec direct I/O
version: 1
url: https://patchwork.kernel.org/series/1160666/