mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] block: two fixes for the zone report ioctls
@ 2026-10-11  5:19 Shashank Mohan Jain
  2026-10-11  5:19 ` [PATCH 1/2] block: only use the cached zone report if BLK_ZONE_REP_CACHED is set Shashank Mohan Jain
  2026-10-11  5:19 ` [PATCH 2/2] block: fix the length of a smaller last zone in blkdev_get_zone_info() Shashank Mohan Jain
  0 siblings, 2 replies; 6+ messages in thread
From: Shashank Mohan Jain @ 2026-10-11  5:19 UTC (permalink / raw)
  To: Jens Axboe, Damien Le Moal
  Cc: Christoph Hellwig, Johannes Thumshirn, Hannes Reinecke,
	Chaitanya Kulkarni, Martin K. Petersen, linux-block,
	linux-kernel

Two problems in the zone report code added in v6.19:

 - BLKREPORTZONEV2 does not look at BLK_ZONE_REP_CACHED and returns the
   cached report also when the flag is not set (patch 1).

 - blkdev_get_zone_info() gives a smaller last zone the length of a
   full zone, so the cached report describes a zone that ends behind
   the end of the device (patch 2).

Both were found by reading the code and then confirmed with zoned
null_blk devices in qemu (x86_64). The test program opens one zone
explicitly, writes to a second zone and closes it, and compares the
reports of BLKREPORTZONE, BLKREPORTZONEV2 with flags 0 and
BLKREPORTZONEV2 with BLK_ZONE_REP_CACHED. On mainline it finds both
problems. With patch 1 only the length of the last zone in the cached
report is left, and with both patches there is no difference apart
from the zone conditions and the write pointer of conventional zones
in the cached report, which are as documented.

For patch 1 there is a choice between the code and the documentation.
The changelog of b30ffcdc0c15 and the comments in the uapi header both
say that without BLK_ZONE_REP_CACHED the report comes from the device,
and BLKREPORTZONE is marked as deprecated in favour of the new ioctl,
so I changed the code. If the cached report is meant to be the only
mode of BLKREPORTZONEV2, the header needs to say so instead.

The series is based on mainline (a5ebb76233b7, v7.3-rc6+). Patch 1
applies to next-20261009 as is. Patch 2 needs its context adjusted
there, because blkdev_get_zone_info() tests the zone type instead of
the zone condition in for-7.4/block.

Shashank Mohan Jain (2):
  block: only use the cached zone report if BLK_ZONE_REP_CACHED is set
  block: fix the length of a smaller last zone in blkdev_get_zone_info()

 block/blk-zoned.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)


base-commit: a5ebb76233b79db01e82e061173cb73c6d2b5c6b
-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-10-11 15:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11  5:19 [PATCH 0/2] block: two fixes for the zone report ioctls Shashank Mohan Jain
2026-10-11  5:19 ` [PATCH 1/2] block: only use the cached zone report if BLK_ZONE_REP_CACHED is set Shashank Mohan Jain
2026-10-11 14:46   ` Damien Le Moal
2026-10-11 15:44     ` shashank Jain
2026-10-11  5:19 ` [PATCH 2/2] block: fix the length of a smaller last zone in blkdev_get_zone_info() Shashank Mohan Jain
2026-10-11 14:47   ` Damien Le Moal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®