summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Cassel <cassel@kernel.org>2026-09-29 10:24:59 +0200
committerMartin K. Petersen (Oracle) <mkp@kernel.org>2026-10-03 10:14:29 -0400
commite5ebe632be40c60ca8d96c8265c9c8c8136aff4a (patch)
tree778a74ad5588f0ec4278b72cae30facacf746bb9
parent45ce384be0cd83116f8440378beef138b9e92a2b (diff)
downloadlinux-next-e5ebe632be40c60ca8d96c8265c9c8c8136aff4a.tar.gz
linux-next-e5ebe632be40c60ca8d96c8265c9c8c8136aff4a.zip
scsi: scsi_debug: Make atomic writes and ZBC emulation mutually exclusive
There are no SMR drives that support atomic writes, so emulating a device with both emulates something a user cannot encounter, and means maintaining the zone handling of a command that no zoned device implements. Nothing in the standards forbids the combination, and for a host managed drive whose logical block size equals its physical block size there is no problem in it either: the vendor only has to give atomic writes an alignment that makes sense with regards to ZBC. This is a choice not to complicate scsi_debug. Refuse the combination at initialisation. It can be changed back if such drives ever appear. Suggested-by: Damien Le Moal <dlemoal@kernel.org> Assisted-by: LLM Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: John Garry <john.garry@linux.dev> Signed-off-by: Niklas Cassel <cassel@kernel.org> Link: https://patch.msgid.link/20260929082456.857423-17-cassel@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
-rw-r--r--drivers/scsi/scsi_debug.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index c664966e95cb..8e45a57ae406 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -8739,6 +8739,11 @@ static int __init scsi_debug_init(void)
return -EINVAL;
}
+ if (sdeb_zbc_in_use && sdebug_atomic_wr) {
+ pr_err("atomic_wr is not supported by a zoned device\n");
+ return -EINVAL;
+ }
+
if (sdebug_dev_size_mb == DEF_DEV_SIZE_PRE_INIT)
sdebug_dev_size_mb = DEF_DEV_SIZE_MB;
if (sdebug_dev_size_mb < 1)