Re: [PATCH v2] file-posix: fix cache.direct=on check for zoned block devices
Stefan Hajnoczi <[email protected]>
| Newsgroups | gmane.comp.emulators.qemu.block,gmane.comp.emulators.qemu |
|---|---|
| Message-ID | <20260729183739.GA1409995@fedora> |
On Wed, Jun 17, 2026 at 03:36:58PM +0200, Niklas Cassel wrote: > For zoned block devices with SWR zones, the order of the writes must be > maintained to avoid write not at write pointer errors. > Thus, cache.direct=on must be used to bypass the page cache, since the > page cache uses write-back caching, where the physical order of the writes > is not guaranteed. > > There is already a check for cache.direct=on in raw_open_common(), > however, this check is done before raw_refresh_zoned_limits() has been > called (which initializes bs->bl.zoned), so it is currently dead code. > > Fix this by moving the check to raw_refresh_zoned_limits(), such that the > check is done after bs->bl.zoned has been initialized. > > Reviewed-by: Damien Le Moal <[email protected]> > Reviewed-by: Dmitry Fomichev <[email protected]> > Fixes: 774c726ceb2a ("block: add zoned BlockDriver check to block layer") > Signed-off-by: Niklas Cassel <[email protected]> > --- > Changes since v1: > -Picked up tags from Damien and Dmitry > -Modified existing code comment to use plural instead of singular > > block/file-posix.c | 22 ++++++++++------------ > 1 file changed, 10 insertions(+), 12 deletions(-) No comments from Kevin and this is a zoned storage fix, so I'm picking it up. QEMU is currently frozen for the 11.1 release and only serious regressions, security fixes, or build fixes should go into the next release candidate (-rc3). I'm applying this to my block-next tree for the next release (11.2). It will hit the master branch in about 2 weeks when 11.1 has been released. Thanks, applied to my block-next tree: https://gitlab.com/stefanha/qemu/commits/block-next Stefan
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmpqSHMACgkQnKSrs4Gr c8hIiQf/YCccaw55JIF27xg8G5HG180yO21g7/ZEX4BzrT66XlsBtXc2ZpUas9bs R0Vz5kNTZBK4YTDDgBLGt/RpNlVJ4Kp3bpd2mXesy1ApdQYaoa3zZi52w0aLOovZ BqblNFTGNDhuNH8PLlRXFmTJA1fQdGQBGiVhULi14D59QExulPuCjV4zc4hnQRus Bdk4fkB+ayt9v52t0HTwAdsXKzBTHHDL4DcV8BlUGhKC0LwiNlHvcB6FJj2zg0F+ trrYSxsId3fXX3oogqMcQVkf/dUYhbrP7Sgo3kmio/aRCWm9oUldPx8T7GY7TuTV U0wh2+bdyVYsi+EwyRdKZKFHXytTFw== =0NUM -----END PGP SIGNATURE-----