From: chenjiayi Date: Mon, 8 Jan 2024 11:45:18 +0000 (+0800) Subject: udev: distinguish host-managed zoned block in scsi_id X-Git-Tag: v256-rc1~1173 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=204594ecf1bc03f0e620e10d8beaec439e7fd6ab;p=thirdparty%2Fsystemd.git udev: distinguish host-managed zoned block in scsi_id According to SPC4, the value of 0x14 is reserved to distinguish host managed zoned block, e.g., some SMR (Shingled Magnetic Recording) disks. Other utilities such as sg3_utils can successfully recognize such kind of disks. This patch implements the same ability. --- diff --git a/src/udev/scsi_id/scsi_id.c b/src/udev/scsi_id/scsi_id.c index 6308c52b7ec..d7d4380851d 100644 --- a/src/udev/scsi_id/scsi_id.c +++ b/src/udev/scsi_id/scsi_id.c @@ -84,6 +84,13 @@ static void set_type(unsigned type_num, char *to, size_t len) { case 0xf: type = "optical"; break; + case 0x14: + /* + * Use "zbc" here to be brief and consistent with "lsscsi" command. + * Other tools, e.g., "sg3_utils" would say "host managed zoned block". + */ + type = "zbc"; + break; default: type = "generic"; break;