file-posix: fix cache.direct=on check for zoned block devices
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 <dlemoal@kernel.org> Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Fixes: 774c726ceb2a ("block: add zoned BlockDriver check to block layer") Signed-off-by: Niklas Cassel <cassel@kernel.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Message-ID: <20260617133658.2022750-1-cassel@kernel.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>