From: Niklas Cassel <cassel@kernel.org>
To: qemu-devel@nongnu.org
Cc: Damien Le Moal <dlemoal@kernel.org>,
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>,
Niklas Cassel <cassel@kernel.org>
Subject: [PATCH v17 9/9] scsi: add the sense codes of zoned block devices
Date: Thu, 12 Nov 2026 12:49:18 +0100 [thread overview]
Message-ID: <20261112114918.1269168-10-cassel@kernel.org> (raw)
In-Reply-To: <20261112114918.1269168-1-cassel@kernel.org>
Add the sense codes that a zoned block device reports when a request
violates the zone model (ZBC-3 and ZAC-3):
ILLEGAL REQUEST, UNALIGNED WRITE COMMAND (21h/04h): a write that
does not start at the write pointer of a sequential write required
zone
ILLEGAL REQUEST, WRITE BOUNDARY VIOLATION (21h/05h): a write that
crosses the end of the writable part of a zone
DATA PROTECT, INSUFFICIENT ZONE RESOURCES (55h/0Eh): a request that
would open or activate more zones than the device allows
The IDE device is going to report them for zoned devices.
Signed-off-by: Niklas Cassel <cassel@kernel.org>
---
include/scsi/utils.h | 6 ++++++
scsi/utils.c | 15 +++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/include/scsi/utils.h b/include/scsi/utils.h
index d5c8efa16e..d16c264b22 100644
--- a/include/scsi/utils.h
+++ b/include/scsi/utils.h
@@ -69,6 +69,10 @@ extern const struct SCSISense sense_code_TARGET_FAILURE;
extern const struct SCSISense sense_code_INVALID_OPCODE;
/* Illegal request, LBA out of range */
extern const struct SCSISense sense_code_LBA_OUT_OF_RANGE;
+/* Illegal request, Unaligned write command */
+extern const struct SCSISense sense_code_UNALIGNED_WRITE;
+/* Illegal request, Write boundary violation */
+extern const struct SCSISense sense_code_WRITE_BOUNDARY_VIOLATION;
/* Illegal request, Invalid field in CDB */
extern const struct SCSISense sense_code_INVALID_FIELD;
/* Illegal request, Invalid field in parameter list */
@@ -119,6 +123,8 @@ extern const struct SCSISense sense_code_DEVICE_INTERNAL_RESET;
extern const struct SCSISense sense_code_WRITE_PROTECTED;
/* Data Protection, Space Allocation Failed Write Protect */
extern const struct SCSISense sense_code_SPACE_ALLOC_FAILED;
+/* Data Protection, Insufficient zone resources */
+extern const struct SCSISense sense_code_INSUFFICIENT_ZONE_RESOURCES;
#define SENSE_CODE(x) sense_code_ ## x
diff --git a/scsi/utils.c b/scsi/utils.c
index 1ee68e6822..9eb41aefdf 100644
--- a/scsi/utils.c
+++ b/scsi/utils.c
@@ -190,6 +190,16 @@ const struct SCSISense sense_code_LBA_OUT_OF_RANGE = {
.key = ILLEGAL_REQUEST, .asc = 0x21, .ascq = 0x00
};
+/* Illegal request, Unaligned write command */
+const struct SCSISense sense_code_UNALIGNED_WRITE = {
+ .key = ILLEGAL_REQUEST, .asc = 0x21, .ascq = 0x04
+};
+
+/* Illegal request, Write boundary violation */
+const struct SCSISense sense_code_WRITE_BOUNDARY_VIOLATION = {
+ .key = ILLEGAL_REQUEST, .asc = 0x21, .ascq = 0x05
+};
+
/* Illegal request, Invalid field in CDB */
const struct SCSISense sense_code_INVALID_FIELD = {
.key = ILLEGAL_REQUEST, .asc = 0x24, .ascq = 0x00
@@ -330,6 +340,11 @@ const struct SCSISense sense_code_SPACE_ALLOC_FAILED = {
.key = DATA_PROTECT, .asc = 0x27, .ascq = 0x07
};
+/* Data Protection, Insufficient zone resources */
+const struct SCSISense sense_code_INSUFFICIENT_ZONE_RESOURCES = {
+ .key = DATA_PROTECT, .asc = 0x55, .ascq = 0x0e
+};
+
/*
* scsi_convert_sense
*
--
2.56.0
next prev parent reply other threads:[~2026-11-12 11:52 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
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 ` Niklas Cassel [this message]
2026-11-15 23:49 ` [PATCH v17 9/9] scsi: add the sense codes of zoned block devices 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=20261112114918.1269168-10-cassel@kernel.org \
--to=cassel@kernel.org \
--cc=armbru@redhat.com \
--cc=daejun7.park@samsung.com \
--cc=dlemoal@kernel.org \
--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.