Package: hdparm
Version: 9.43-2
Severity: important

Mistake in /lib/udev/rules.d/85-hdparm.rules:
    ACTION=="add", SUBSYSTEM=="block", KERNEL=="[sh]d[a-z]*", 
RUN+="/lib/udev/hdparm"
should be 
    ACTION=="add", SUBSYSTEM=="block", KERNEL=="[sh]d[a-z]", 
RUN+="/lib/udev/hdparm"

As it is now, the rule matches when partitions are detected by udev,
typically after the disk device, and /lib/udev/hdparm is invoked with
e.g. DEVNAME=/dev/sda2 after being invoked with DEVNAME=/dev/sda.
I'm quite confident this is not the behaviour most users expect.

Brain damage in /lib/hdparm/hdparm-functions:
hdparm_options() contains 
        # set our default global apm policy here.
        if hdparm_try_apm "$WANTED_DISK"; then
            if hdparm_is_on_battery; then
                hdparm_set_option -B128
                ...
            else
                hdparm_set_option -B254
            fi
        fi
which causes it to emit "-B254" or "-B128" even if no stanza in
/etc/hdparm.conf matches the device name (and usually hdparm.conf has
no stanza for partitions).  Since the ioctl() on the partition acts in
fact on the disk, the result is that power management is set on the disk
depending only on battery vs AC status, overriding user's preferences
listed in /etc/hdparm.conf for the disk.

As a side note: duplicating (almost) the parsing logic of
/etc/init.d/hdparm in /lib/hdparm/hdparm-functions is an efficient way
to let bugs slip through.

Best regards
        g

-- System Information:
Debian Release: 8.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.16.0-4-686-pae (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages hdparm depends on:
ii  libc6     2.19-18
ii  lsb-base  4.1+Debian13+nmu1

Versions of packages hdparm recommends:
pn  powermgmt-base  <none>

Versions of packages hdparm suggests:
pn  apmd  <none>

-- Configuration Files:
/etc/hdparm.conf changed:
/dev/sda {
    apm = 128
    apm_battery = 128
    quiet
}


-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to