Re: [systemd-devel] udev: 60-persistent-storage.rules attempts blkid on removable devices with no medium present

2015-02-17 Thread Oliver Neukum
On Mon, 2015-02-16 at 14:52 -0800, Hans Scholze wrote:
 Hi,
 
 
 I'm not sure if this is considered a problem but I noticed some
 spurious error messages during boot.  The source appears to be:
 
 
 1. a USB media card reader is plugged in at boot
 2. the device node exists regardless of whether a card is present
 (expected)
 3. line 70 of 60-persistent-storage.rules (KERNEL!=sr*,
 IMPORT{builtin}=blkid) attempts blkid on the device with no card
 present
 4. the open() call in builtin_blkid() in udev-builtin-blkid.c fails
 resulting in an error: /dev/sdd: No medium found message printed to
 stderr
 
That seems to be the error. You cannot guarantee that blkid will never
see this error if the drive has removable media. It should have an
option for silently failing in these cases.

Regards
Oliver



___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] udev: 60-persistent-storage.rules attempts blkid on removable devices with no medium present

2015-02-16 Thread Hans Scholze
Hi,

I'm not sure if this is considered a problem but I noticed some spurious
error messages during boot.  The source appears to be:

1. a USB media card reader is plugged in at boot
2. the device node exists regardless of whether a card is present (expected)
3. line 70 of 60-persistent-storage.rules (KERNEL!=sr*,
IMPORT{builtin}=blkid) attempts blkid on the device with no card present
4. the open() call in builtin_blkid() in udev-builtin-blkid.c fails
resulting in an error: /dev/sdd: No medium found message printed to stderr

Adding ATTR{removable}==1, ATTR{size}==0, GOTO=skip_blkid around the
rule seems to work in my case but I don't know if that is a good thing to
do in general.

For comparison, the rules that run blkid on CD drives (lines 62-67) do
check first to make sure a CD is inserted.  (At least I think that's
what ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}==?*
is doing.)

Some other discussions I came across related to the No medium found
message:
https://bbs.archlinux.org/viewtopic.php?id=190229
https://bugs.freedesktop.org/show_bug.cgi?id=86414

Thanks,
Hans
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel