* Re: [PATCH] HAL: Ignore internal DM devices with new DM udev rules
2010-07-13 12:08 [PATCH] HAL: Ignore internal DM devices with new DM udev rules Milan Broz
@ 2010-07-14 9:12 ` Robby Workman
2010-07-14 9:43 ` Milan Broz
1 sibling, 0 replies; 3+ messages in thread
From: Robby Workman @ 2010-07-14 9:12 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 1501 bytes --]
On Tue, 13 Jul 2010 14:08:14 +0200
Milan Broz <mbroz@redhat.com> wrote:
> With new device-mapper udev rules are /dev/mapper/* symlinks
> to basic device name /dev/dm-X.
> (Change requested by udev upstream.)
>
> This change breaks temporary-cryptsetup workaround inside hal.
>
> With new dm-udev rules (uncluded since device-mapper 1.02.39)
> there is DM_UDEV_DISABLE_OTHER_RULES_FLAG variable
> which controls that scan should be ignored for this device
> (it is set for all internal devices, including temporary cryptsetup,
> internal parts of lvm devices etc.)
>
> Ignore device if this flag is set.
>
> See bugs
> https://bugzilla.redhat.com/show_bug.cgi?id=613909
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586286
Perhaps this is a problem with how Xfce's automount implementation
calls everything (although it worked fine prior to our move to
udev-enabled LVM2 and newer cryptsetup (1.1.x)), but I still don't
get an encrypted usb thumbdrive mounted when plugging it in after
applying this patch and rebuilding hal.
I get two separate dialog windows to enter the passphrase
(the first appears, I enter the passphrase, and then the
second appears), and after entering the passphrase for the
second time, I get this:
Failed to setup the encrypted volume.
/dev/sdb is already setup?
Just for grins and giggles, I tested an old mmc card, and it
works as expected.
I'm attaching a debug log created by running hald in verbose
mode; any ideas on where to go from here?
-RW
[-- Attachment #2: debug --]
[-- Type: application/octet-stream, Size: 10163 bytes --]
[5822]: 04:04:08.000 [I] addon-storage.c:356: Checking whether device /dev/sdb is locked on HAL
[5822]: 04:04:08.000 [I] addon-storage.c:365: ... device /dev/sdb is not locked on HAL
[5822]: 04:04:08.001 [D] addon-storage.c:548: Media insertion detected on /dev/sdb
04:04:08.001 [D] hald_dbus.c:1659: udi=/org/freedesktop/Hal/devices/storage_serial_SanDisk_Cruzer_Micro_SNDK5D1BF51877607705_0_0, key=storage.removable.media_available
04:04:08.001 [I] hald_dbus.c:3115: entering, local_interface=1
04:04:08.002 [D] hald_dbus.c:3124: udi=/org/freedesktop/Hal/devices/storage_serial_SanDisk_Cruzer_Micro_SNDK5D1BF51877607705_0_0
04:04:08.002 [I] blockdev.c:1780: blockdev_rescan_device: udi=/org/freedesktop/Hal/devices/storage_serial_SanDisk_Cruzer_Micro_SNDK5D1BF51877607705_0_0
Run started hald-probe-storage (20000) (0)
! full path is '/usr/libexec/hald-probe-storage', program_dir is '/usr/libexec'
woohoo
[5825]: 04:04:08.009 [D] probe-storage.c:142: Doing probe-storage for /dev/sdb (bus usb) (drive_type disk) (udi=/org/freedesktop/Hal/devices/storage_serial_SanDisk_Cruzer_Micro_SNDK5D1BF51877607705_0_0) (--only-check-for-fs==1)
[5825]: 04:04:08.010 [D] probe-storage.c:440: Checking for file system on /dev/sdb
[5825]: 04:04:08.010 [D] probe-storage.c:446: Doing open ("/dev/sdb", O_RDONLY)
[5825]: 04:04:08.010 [D] probe-storage.c:454: Returned from open(2)
[5825]: 04:04:08.010 [D] probe-storage.c:470: look for existing partitions for sdb
04:04:08.023 [I] hald_dbus.c:1371: storage.removable.media_available -> True
04:04:08.023 [I] hald_dbus.c:1355: storage.removable.media_size -> 1024966656
04:04:08.023 [I] hald_dbus.c:1339: storage.partitioning_scheme -> none
pid 5825: rc=2 signaled=0: /usr/libexec/hald-probe-storage
04:04:08.024 [I] blockdev.c:1736: hald-probe-storage --only-check-for-media returned 2 (exit_type=0)
04:04:08.024 [D] hotplug.c:500: events queued = 0, events in progress = 0
04:04:08.024 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
04:04:18.543 [I] hald_dbus.c:5198: OK for method 'Setup' with signature 's' on interface 'org.freedesktop.Hal.Device.Volume.Crypto' for UDI '/org/freedesktop/Hal/devices/volume_uuid_10660ad9_8d12_4c12_bd3e_c45f4960bd43' and execpath 'hal-luks-setup'
04:04:18.543 [I] hald_dbus.c:4082: no need to enqueue
Run started hal-luks-setup (0) (1)
! full path is '/usr/libexec/scripts/hal-luks-setup', program_dir is '/usr/libexec/scripts'
04:04:18.550 [I] access-check.c:72: uid for caller is 0
04:04:18.551 [I] ci-tracker.c:212: Removing CICallerInfo object for :1.200
04:04:18.551 [I] device.c:1894: Removing locks from ':1.200'
04:04:18.554 [I] access-check.c:72: uid for caller is 0
04:04:18.555 [I] ci-tracker.c:212: Removing CICallerInfo object for :1.201
04:04:18.555 [I] device.c:1894: Removing locks from ':1.201'
04:04:18.560 [I] device.c:1894: Removing locks from ':1.202'
04:04:19.530 [I] osspec.c:256: SEQNUM=2241, ACTION=add, SUBSYSTEM=bdi, DEVPATH=/sys/devices/virtual/bdi/253:6, DEVNAME=, IFINDEX=0
04:04:19.530 [D] hotplug.c:476: checking ADD event /sys/devices/virtual/bdi/253:6
04:04:19.530 [D] hotplug.c:397: event /sys/devices/virtual/bdi/253:6: skip ourselves and all later events
04:04:19.530 [I] hotplug.c:145: /sys/devices/virtual/bdi/253:6 is a device (subsystem)
04:04:19.530 [I] device.c:4997: add_dev: subsys=bdi sysfs_path=/sys/devices/virtual/bdi/253:6 dev= parent_dev=0x00000000
04:04:19.530 [D] hotplug.c:500: events queued = 0, events in progress = 0
04:04:19.530 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
04:04:19.530 [I] osspec.c:220: ignoring device requested by DM udev rules
04:04:19.531 [I] osspec.c:220: ignoring device requested by DM udev rules
04:04:19.532 [I] osspec.c:220: ignoring device requested by DM udev rules
04:04:19.561 [I] osspec.c:220: ignoring device requested by DM udev rules
04:04:19.563 [I] osspec.c:256: SEQNUM=2245, ACTION=remove, SUBSYSTEM=bdi, DEVPATH=/sys/devices/virtual/bdi/253:6, DEVNAME=, IFINDEX=0
04:04:19.563 [D] hotplug.c:478: checking REMOVE event /sys/devices/virtual/bdi/253:6
04:04:19.563 [D] hotplug.c:397: event /sys/devices/virtual/bdi/253:6: skip ourselves and all later events
04:04:19.563 [I] device.c:5078: remove_dev: subsys=bdi sysfs_path=/sys/devices/virtual/bdi/253:6
04:04:19.563 [W] device.c:5082: Error removing device
04:04:19.563 [D] hotplug.c:500: events queued = 0, events in progress = 0
04:04:19.563 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
04:04:19.564 [I] osspec.c:256: SEQNUM=2246, ACTION=remove, SUBSYSTEM=block, DEVPATH=/sys/devices/virtual/block/dm-6, DEVNAME=dm-6, IFINDEX=0
04:04:19.564 [D] hotplug.c:478: checking REMOVE event /sys/devices/virtual/block/dm-6
04:04:19.564 [D] hotplug.c:397: event /sys/devices/virtual/block/dm-6: skip ourselves and all later events
04:04:19.564 [I] blockdev.c:1663: block_rem: sysfs_path=/sys/devices/virtual/block/dm-6
04:04:19.564 [W] blockdev.c:1667: Device is not in the HAL database
04:04:19.564 [D] hotplug.c:500: events queued = 0, events in progress = 0
04:04:19.564 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
04:04:19.700 [I] osspec.c:220: ignoring device requested by DM udev rules
04:04:19.701 [I] osspec.c:256: SEQNUM=2249, ACTION=add, SUBSYSTEM=bdi, DEVPATH=/sys/devices/virtual/bdi/253:6, DEVNAME=, IFINDEX=0
04:04:19.701 [D] hotplug.c:476: checking ADD event /sys/devices/virtual/bdi/253:6
04:04:19.701 [D] hotplug.c:397: event /sys/devices/virtual/bdi/253:6: skip ourselves and all later events
04:04:19.701 [I] hotplug.c:145: /sys/devices/virtual/bdi/253:6 is a device (subsystem)
04:04:19.701 [I] device.c:4997: add_dev: subsys=bdi sysfs_path=/sys/devices/virtual/bdi/253:6 dev= parent_dev=0x00000000
04:04:19.701 [D] hotplug.c:500: events queued = 0, events in progress = 0
04:04:19.701 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
04:04:19.735 [I] osspec.c:256: SEQNUM=2247, ACTION=change, SUBSYSTEM=block, DEVPATH=/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host9/target9:0:0/9:0:0:0/block/sdb, DEVNAME=/dev/sdb, IFINDEX=0
04:04:19.735 [D] hotplug.c:480: checking event /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host9/target9:0:0/9:0:0:0/block/sdb, action: 4
04:04:19.735 [D] hotplug.c:397: event /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host9/target9:0:0/9:0:0:0/block/sdb: skip ourselves and all later events
04:04:19.735 [I] blockdev.c:1716: block_change: sysfs_path=/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host9/target9:0:0/9:0:0:0/block/sdb
04:04:19.735 [D] hotplug.c:500: events queued = 0, events in progress = 0
04:04:19.735 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
04:04:20.064 [D] osspec.c:249: Found a dm-device (/dev/dm-6), mark it
04:04:20.064 [I] osspec.c:256: SEQNUM=2250, ACTION=change, SUBSYSTEM=block, DEVPATH=/sys/devices/virtual/block/dm-6, DEVNAME=/dev/dm-6, IFINDEX=0
04:04:20.064 [D] hotplug.c:480: checking event /sys/devices/virtual/block/dm-6, action: 4
04:04:20.064 [D] hotplug.c:397: event /sys/devices/virtual/block/dm-6: skip ourselves and all later events
04:04:20.065 [I] blockdev.c:904: block_add: sysfs_path=/sys/devices/virtual/block/dm-6 dev=/dev/dm-6 is_part=0, parent=0x00000000
04:04:20.065 [I] blockdev.c:958: Looking in /sys/devices/virtual/block/dm-6/slaves for Device Mapper
04:04:20.065 [I] blockdev.c:969: /sys/devices/virtual/block/dm-6/slaves/. -> /sys/devices/virtual/block/dm-6/slaves
04:04:20.065 [I] blockdev.c:1003: Couldn't find slave volume in devices
04:04:20.065 [I] blockdev.c:969: /sys/devices/virtual/block/dm-6/slaves/.. -> /sys/devices/virtual/block/dm-6
04:04:20.065 [I] blockdev.c:1003: Couldn't find slave volume in devices
04:04:20.065 [I] blockdev.c:969: /sys/devices/virtual/block/dm-6/slaves/sdb -> /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host9/target9:0:0/9:0:0:0/block/sdb
04:04:20.065 [I] blockdev.c:1009: Done looking in /sys/devices/virtual/block/dm-6/slaves
04:04:20.065 [I] blockdev.c:1016: Ignoring hotplug event - no parent
04:04:20.065 [W] blockdev.c:1587: Not adding device object
04:04:20.065 [D] hotplug.c:500: events queued = 0, events in progress = 0
04:04:20.065 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
04:04:20.087 [I] device.c:1894: Removing locks from ':1.203'
pid 5826: rc=0 signaled=0: /usr/libexec/scripts/hal-luks-setup
04:04:20.087 [I] hald_dbus.c:4106: No more methods in queue
04:04:20.087 [D] hotplug.c:500: events queued = 0, events in progress = 0
04:04:20.087 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
04:04:59.627 [I] hald_dbus.c:5198: OK for method 'Setup' with signature 's' on interface 'org.freedesktop.Hal.Device.Volume.Crypto' for UDI '/org/freedesktop/Hal/devices/volume_uuid_10660ad9_8d12_4c12_bd3e_c45f4960bd43' and execpath 'hal-luks-setup'
04:04:59.627 [I] hald_dbus.c:4082: no need to enqueue
Run started hal-luks-setup (0) (1)
! full path is '/usr/libexec/scripts/hal-luks-setup', program_dir is '/usr/libexec/scripts'
04:04:59.632 [I] access-check.c:72: uid for caller is 0
04:04:59.633 [I] ci-tracker.c:212: Removing CICallerInfo object for :1.204
04:04:59.633 [I] device.c:1894: Removing locks from ':1.204'
04:04:59.637 [I] access-check.c:72: uid for caller is 0
04:04:59.638 [I] ci-tracker.c:212: Removing CICallerInfo object for :1.205
04:04:59.638 [I] device.c:1894: Removing locks from ':1.205'
04:04:59.642 [I] device.c:1894: Removing locks from ':1.206'
pid 5866: rc=1 signaled=0: /usr/libexec/scripts/hal-luks-setup
04:04:59.646 [I] hald_dbus.c:4106: No more methods in queue
04:04:59.646 [I] hald_dbus.c:4169: failed with 'org.freedesktop.Hal.Device.Volume.Crypto.SetupError' '/dev/sdb is already setup?'
04:04:59.646 [D] hotplug.c:500: events queued = 0, events in progress = 0
04:04:59.646 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
04:05:18.890 [I] ci-tracker.c:212: Removing CICallerInfo object for :1.199
04:05:18.890 [I] device.c:1894: Removing locks from ':1.199'
04:05:18.970 [I] device.c:1894: Removing locks from ':1.207'
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] HAL: Ignore internal DM devices with new DM udev rules
2010-07-13 12:08 [PATCH] HAL: Ignore internal DM devices with new DM udev rules Milan Broz
2010-07-14 9:12 ` Robby Workman
@ 2010-07-14 9:43 ` Milan Broz
1 sibling, 0 replies; 3+ messages in thread
From: Milan Broz @ 2010-07-14 9:43 UTC (permalink / raw)
To: linux-hotplug
On 07/14/2010 11:12 AM, Robby Workman wrote:
> On Tue, 13 Jul 2010 14:08:14 +0200
> Milan Broz <mbroz@redhat.com> wrote:
> I get two separate dialog windows to enter the passphrase
> (the first appears, I enter the passphrase, and then the
> second appears), and after entering the passphrase for the
> second time, I get this:
sigh. If udev rule set this flag, it is not top-level device
and nobody should touch it.
Top level device is then visible, that's the one you want to mount...
if you see the log, event comes there for top-level:
04:04:20.064 [D] osspec.c:249: Found a dm-device (/dev/dm-6), mark it
04:04:20.064 [I] osspec.c:256: SEQNUM"50, ACTION=change, SUBSYSTEM=block, DEVPATH=/sys/devices/virtual/block/dm-6, DEVNAME=/dev/dm-6, IFINDEX=0
so I do not think it is problem with this patch.
But in fact I have no idea how the whole desktop machinery above
that works, I expect that there is some race with another auto mount
system - see dmsetup table if the device is not mapped elsewhere already:-)
Milan
^ permalink raw reply [flat|nested] 3+ messages in thread