Skip to content

block, nfsd: fixes for sub-sector bvec direct I/O - #1272

Closed
blktests-ci-kpd[bot] wants to merge 1 commit into
linus-master_basefrom
series/1160666=>linus-master
Closed

blktests-ci-kpd[bot] wants to merge 1 commit into
linus-master_basefrom
series/1160666=>linus-master

Conversation

@blktests-ci-kpd

Copy link
Copy Markdown

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/

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 28924df
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 893e117
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from f4d8902 to 8013db8 Compare September 9, 2026 08:01
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 50d05c7
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 8013db8 to 096d4de Compare September 10, 2026 15:43
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 5225b8e
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 096d4de to 6cb2bc5 Compare September 12, 2026 02:38
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 2f0c1cf
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 6cb2bc5 to 9659271 Compare September 13, 2026 10:07
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 2f0c1cf
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 5878583
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 79c5eae to f8453da Compare September 15, 2026 09:43
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 4982d35
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from f8453da to 6c9a7ea Compare September 17, 2026 19:54
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 5dd1818
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 6c9a7ea to 899bbab Compare September 18, 2026 13:43
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 72d3fcf
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 0967633 to 34450ca Compare September 28, 2026 15:24
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 551c722
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 34450ca to 5218bde Compare October 1, 2026 16:17
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: ce1e022
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 5218bde to 960638f Compare October 1, 2026 23:55
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: e767a4e
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 960638f to 5aaded0 Compare October 3, 2026 10:18
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: a74306e
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 5aaded0 to 26d3808 Compare October 3, 2026 22:27
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: None
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 26d3808 to aefaac0 Compare October 5, 2026 02:34
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 22430ae
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from aefaac0 to 36093b4 Compare October 6, 2026 13:18
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 69f80fe
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 36093b4 to 347900b Compare October 6, 2026 17:32
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>
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 7b63ef2
series: https://patchwork.kernel.org/series/1160666/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160666=>linus-master branch from 347900b to 87c6ebf Compare October 7, 2026 16:19
@blktests-ci-kpd

Copy link
Copy Markdown
Author

At least one diff in series https://patchwork.kernel.org/series/1160666/ irrelevant now for [{'archived': False, 'project': 241}] search patterns

@blktests-ci-kpd blktests-ci-kpd Bot closed this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants