]> git.ipfire.org Git - thirdparty/qemu.git/commit
file-posix: Check bs->bl.zoned for zone info
authorHanna Czenczek <hreitz@redhat.com>
Thu, 24 Aug 2023 15:53:41 +0000 (17:53 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 2 Oct 2023 23:00:54 +0000 (02:00 +0300)
commit825af96d6a4fbc6c5e41fc892bbf903ab74873f4
treee285f489658f07fc0acaa6a5729e97c6a09e4fb9
parentc2e6a00b5fb96bfb4f47b8b8fa984b1209da84d8
file-posix: Check bs->bl.zoned for zone info

Instead of checking bs->wps or bs->bl.zone_size for whether zone
information is present, check bs->bl.zoned.  That is the flag that
raw_refresh_zoned_limits() reliably sets to indicate zone support.  If
it is set to something other than BLK_Z_NONE, other values and objects
like bs->wps and bs->bl.zone_size must be non-null/zero and valid; if it
is not, we cannot rely on their validity.

Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
Message-Id: <20230824155345.109765-3-hreitz@redhat.com>
Reviewed-by: Sam Li <faithilikerun@gmail.com>
(cherry picked from commit 4b5d80f3d02096a9bb1f651f6b3401ba40877159)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
block/file-posix.c