diff --git a/smartmontools/ChangeLog b/smartmontools/ChangeLog index 0232014ed31242852e568dfca2d36065fc11f4ed..10ee1fe34e28246612729dcb565468a10bba2240 100644 --- a/smartmontools/ChangeLog +++ b/smartmontools/ChangeLog @@ -2,6 +2,10 @@ $Id$ 2023-05-30 Christian Franke <franke@computer.org> + nvmecmds.cpp, nvmprint.cpp: Also suppress NVMe Namespace IEEE EUI-64 + info if '-q noserial' is specified. + smartctl.8.in: Update '-q noserial' documentation. + smartd.cpp: Don't report new non-device related errors as critical (#1222). smartd.conf.5.in: Document new functionality. diff --git a/smartmontools/nvmecmds.cpp b/smartmontools/nvmecmds.cpp index ee45a61ef90a15aaf4bcf21e1384a6bb6263044c..ead99518c93f6fee2e05761450a87f8a7734d59a 100644 --- a/smartmontools/nvmecmds.cpp +++ b/smartmontools/nvmecmds.cpp @@ -72,11 +72,17 @@ static bool nvme_pass_through(nvme_device * device, const nvme_cmd_in & in, pout(" [Duration: %.6fs]\n", duration_usec / 1000000.0); } - if ( dont_print_serial_number && ok - && in.opcode == nvme_admin_identify && in.cdw10 == 0x01) { - // Invalidate serial number - nvme_id_ctrl & id_ctrl = *reinterpret_cast<nvme_id_ctrl *>(in.buffer); - memset(id_ctrl.sn, 'X', sizeof(id_ctrl.sn)); + if (dont_print_serial_number && ok && in.opcode == nvme_admin_identify) { + if (in.cdw10 == 0x01 && in.size >= sizeof(nvme_id_ctrl)) { + // Identify controller: Invalidate serial number + nvme_id_ctrl & id_ctrl = *reinterpret_cast<nvme_id_ctrl *>(in.buffer); + memset(id_ctrl.sn, 'X', sizeof(id_ctrl.sn)); + } + else if (in.cdw10 == 0x00 && in.size >= sizeof(nvme_id_ns)) { + // Identify namespace: Invalidate IEEE EUI-64 + nvme_id_ns & id_ns = *reinterpret_cast<nvme_id_ns *>(in.buffer); + memset(id_ns.eui64, 0x00, sizeof(id_ns.eui64)); + } } if (nvme_debugmode) { diff --git a/smartmontools/nvmeprint.cpp b/smartmontools/nvmeprint.cpp index 13307895c200ae1744ae25bd0973af1a4ec6f245..4a35254d3198f6d03d87d4de56c0384321d0aba0 100644 --- a/smartmontools/nvmeprint.cpp +++ b/smartmontools/nvmeprint.cpp @@ -192,7 +192,7 @@ static void print_drive_info(const nvme_id_ctrl & id_ctrl, const nvme_id_ns & id jrns["formatted_lba_size"] = (1U << fmt_lba_bits); jglb["logical_block_size"] = (1U << fmt_lba_bits); - if (show_all || nonempty(id_ns.eui64, sizeof(id_ns.eui64))) { + if (!dont_print_serial_number && (show_all || nonempty(id_ns.eui64, sizeof(id_ns.eui64)))) { jout("Namespace %u IEEE EUI-64: %s%02x%02x%02x %02x%02x%02x%02x%02x\n", nsid, align, id_ns.eui64[0], id_ns.eui64[1], id_ns.eui64[2], id_ns.eui64[3], id_ns.eui64[4], id_ns.eui64[5], id_ns.eui64[6], id_ns.eui64[7]); diff --git a/smartmontools/smartctl.8.in b/smartmontools/smartctl.8.in index c17fc5932cc578c30dfad1d4e41f83276d615317..cc2d9aef479a5f5d9b4bcbe8b749a562961f79e6 100644 --- a/smartmontools/smartctl.8.in +++ b/smartmontools/smartctl.8.in @@ -382,6 +382,13 @@ use the exit status of \fBsmartctl\fP (see EXIT STATUS below). .Sp .I noserial \- Do not print the serial number of the device. +This also suppresses the LU WWN Device Id (ATA) and the SAS addresses (SCSI). +The related fields are also invalidated in the ATA and NVMe debug outputs. +.br +Note: This is not the case in SCSI debug output. +.br +[NEW EXPERIMENTAL SMARTCTL FEATURE] +The Namespace IEEE EUI-64 (NVMe) is also suppressed. .TP .B \-d TYPE, \-\-device=TYPE Specifies the type of the device.