OSDN Git Service

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)
committerHanna Czenczek <hreitz@redhat.com>
Tue, 29 Aug 2023 08:50:38 +0000 (10:50 +0200)
commit4b5d80f3d02096a9bb1f651f6b3401ba40877159
treebfcbef05e5da298ec6a04d5041ea44b1ae4fb5ae
parent56d1a022a77ea2125564913665eeadf3e303a671
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>
block/file-posix.c