From: Damien Le Moal <dlemoal@kernel.org>
To: Niklas Cassel <cassel@kernel.org>, qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Hanna Reitz <hreitz@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Kevin Wolf <kwolf@redhat.com>, Eric Blake <eblake@redhat.com>,
qemu-block@nongnu.org, Sam Li <faithilikerun@gmail.com>,
Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>,
Jeuk Kim <jeuk20.kim@samsung.com>,
Daejun Park <daejun7.park@samsung.com>
Subject: Re: [PATCH v17 3/9] block: define errnos for zone protocol errors
Date: Sun, 15 Nov 2026 15:45:55 -0800 [thread overview]
Message-ID: <8e0733ae-28c3-427b-bfe0-20e82347ce0c@kernel.org> (raw)
In-Reply-To: <20261112114918.1269168-4-cassel@kernel.org>
On 11/12/26 03:49, Niklas Cassel wrote:
> A block driver that emulates zones (e.g. qcow2 with the zoned format
> feature) rejects requests that violate the zone protocol, and the device
> model has to report each of these to the guest with the matching zone
> error (ZAC/ZBC sense data, virtio-blk zone status codes, ...). It can
> only do so if each condition comes with an errno of its own, rather than
> a generic one such as EIO.
>
> Define one for each condition:
>
> BLK_ZE_UNALIGNED_WRITE ESPIPE write not at the write pointer
> BLK_ZE_BOUNDARY ERANGE write past the zone capacity
> BLK_ZE_OPEN_RESOURCE ETOOMANYREFS open zone limit reached
> BLK_ZE_ACTIVE_RESOURCE EOVERFLOW active zone limit reached
> BLK_ZE_FULL EXFULL write to a full zone
>
> ETOOMANYREFS and EOVERFLOW are what Linux returns for
> BLK_STS_ZONE_OPEN_RESOURCE and BLK_STS_ZONE_ACTIVE_RESOURCE, so a host
> zoned device used through file-posix already reports the same values.
> For the boundary case, ERANGE is used rather than EFBIG, which the host
> file system can legitimately return for an image file.
>
> A write that is not at the write pointer gets ESPIPE, which file and
> block device I/O never return, rather than EINVAL, which a zoned driver
> also uses for invalid requests such as an invalid zone state
> transition. So a device model can map each of these errnos to its zone
> error without having to know which request failed.
>
> A full zone has no write pointer, and ZAC, ZBC, NVMe ZNS and virtio-blk
> all report a write to a full zone differently from a write that is not
> at the write pointer, so it gets its own errno, EXFULL.
>
> ETOOMANYREFS is not POSIX and EXFULL is Linux-specific, so provide
> fallbacks for hosts that lack them.
>
> Signed-off-by: Niklas Cassel <cassel@kernel.org>
Looks OK to me.
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2026-11-15 23:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 11:49 [PATCH v17 0/9] Add full zoned storage emulation to the qcow2 driver Niklas Cassel
2026-11-12 11:49 ` [PATCH v17 1/9] docs/qcow2: add the zoned format feature Niklas Cassel
2026-11-12 11:49 ` [PATCH v17 2/9] qcow2: add configurations for zoned format extension Niklas Cassel
2026-11-12 11:49 ` [PATCH v17 3/9] block: define errnos for zone protocol errors Niklas Cassel
2026-11-15 23:45 ` Damien Le Moal [this message]
2026-11-12 11:49 ` [PATCH v17 4/9] qcow2: add zoned emulation capability Niklas Cassel
2026-11-12 11:49 ` [PATCH v17 5/9] iotests: test the zoned format feature for qcow2 file Niklas Cassel
2026-11-12 11:49 ` [PATCH v17 6/9] qcow2: validate the write pointer table when opening an image Niklas Cassel
2026-11-12 11:49 ` [PATCH v17 7/9] virtio-blk: report zone errors with their zone status codes Niklas Cassel
2026-11-15 23:48 ` Damien Le Moal
2026-11-12 11:49 ` [PATCH v17 8/9] block: add accessors for the zone model, capacity and open zone limit Niklas Cassel
2026-11-15 23:48 ` Damien Le Moal
2026-11-12 11:49 ` [PATCH v17 9/9] scsi: add the sense codes of zoned block devices Niklas Cassel
2026-11-15 23:49 ` Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8e0733ae-28c3-427b-bfe0-20e82347ce0c@kernel.org \
--to=dlemoal@kernel.org \
--cc=armbru@redhat.com \
--cc=cassel@kernel.org \
--cc=daejun7.park@samsung.com \
--cc=eblake@redhat.com \
--cc=faithilikerun@gmail.com \
--cc=fam@euphon.net \
--cc=hreitz@redhat.com \
--cc=jeuk20.kim@samsung.com \
--cc=kwolf@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.