udev: distinguish host-managed zoned block in scsi_id
authorchenjiayi <chenjiayi22@huawei.com>
Mon, 8 Jan 2024 11:45:18 +0000 (19:45 +0800)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 12 Jan 2024 15:52:38 +0000 (15:52 +0000)
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.

src/udev/scsi_id/scsi_id.c

index 6308c52b7ec33d790cbb713c6a025c94aeec5628..d7d4380851d0736e93fd3fc57aba94df74c1212f 100644 (file)
@@ -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;