Package: hdparm
Version: 9.58+ds-1
Severity: normal

Dear Maintainer,

We have been checking APM settings for our servers running Debian 10, which 
contain many JBOD disk drives, and have discovered that some disks do not get 
the APM set to 254. Another anomaly was that in Debian 8, we have the expected 
APM value set to 254. 

Further analysis showed that all affected disks on Debian 10 have device node 
names with four letters (opposed to standard three), such as/dev/sdaf, 
/dev/sdag. 

The investigation showed that ‘/lib/udev/hdparm’ is not triggered by the udev 
rule upon disk discovery.

The udev rule installed by hdparm located at  
‘/lib/udev/rules.d/85-hdparm.rules’ contains the following rule:
ACTION=="add", SUBSYSTEM=="block", KERNEL=="[sh]d[a-z]", RUN+="/lib/udev/hdparm"

From the rule above, it is clear that it won’t get triggered for a block device 
that has four or more letters in the name.

We have identified the following change which caused the regression from Debian 
8 behavior:
https://salsa.debian.org/debian/hdparm/-/commit/0b2a7cfbddc55f6b84ecef3a5af82af859473e56

While it fixes a valid bug, it also introduces the regression we’ve detected.

We recommend to change the rule to the following:
ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="sd*[!0-9]", 
RUN+="/lib/udev/hdparm"

Such a rule would fix the regression problem and would also retain the fix for 
the problem described in #787969. The ‘ENV{DEVTYPE}=="disk"’ would add an extra 
safeguard.

Also, it does not make any more sense to match block devices that start with 
‘ad’ since libata has been there for many years and ATA devices are attached to 
the SCSI subsystem.

It would also be great to fix this in all affected Debian releases starting 
with Debian 9 ‘stretch’.

Cheers,
Vaidas


-- System Information:
Debian Release: 10.10
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.52 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages hdparm depends on:
ii  libc6     2.28-10
ii  lsb-base  10.2019051400

Versions of packages hdparm recommends:
ii  powermgmt-base  1.34

Versions of packages hdparm suggests:
pn  apmd  <none>

-- no debconf information

Reply via email to