From 35275fa7d82f73f42995bd4f0d41836eb933179a Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 27 Sep 2024 14:58:37 +0200 Subject: [PATCH] smart: Clarify ID_ATA_SMART_ACCESS udev property values Turned out the value of 'none' is actually useful to blacklist and prevent any I/O to a device that would break, disconnect or otherwise error out. https://bugzilla.redhat.com/show_bug.cgi?id=515881#c24 --- src/plugins/smart/smart-common.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/plugins/smart/smart-common.c b/src/plugins/smart/smart-common.c index 9c054c46..859dad36 100644 --- a/src/plugins/smart/smart-common.c +++ b/src/plugins/smart/smart-common.c @@ -146,14 +146,25 @@ * libblockdev generally tends to avoid any udev interaction, leaving the burden * to callers. * - * Valid values for this property include `auto`, `linux-ide`, `sat16`, `sat12`, - * `sunplus`, `jmicron`. + * Valid values for this property include: + * - `'sat16'`: 16 Byte SCSI ATA SAT Passthru + * - `'sat12'`: 12 Byte SCSI ATA SAT Passthru + * - `'linux-ide'`: Native Linux IDE + * - `'sunplus'`: SunPlus USB/ATA bridges + * - `'jmicron'`: JMicron USB/ATA bridges + * - `'none'`: No access method, avoid any I/O and ignore the device + * - `'auto'`: Autodetection based on parent subsystem (default) * * A common example to override QEMU ATA device type, which often requires legacy * IDE protocol: * |[ * KERNEL=="sd*", ENV{ID_VENDOR}=="ATA", ENV{ID_MODEL}=="QEMU_HARDDISK", ENV{ID_ATA}=="1", ENV{ID_ATA_SMART_ACCESS}="linux-ide" * ]| + * + * An example of blacklisting a USB device, in case of errors caused by reading SMART data: + * |[ + * ATTRS{idVendor}=="152d", ATTRS{idProduct}=="2329", ENV{ID_ATA_SMART_ACCESS}="none" + * ]| */ /**