[pkg-cryptsetup-devel] Bug#586286: Bug#586286: device-mapper: ioctl: unable to remove open device temporary-cryptsetup-3433

Γιώργος Γιώργος
Sat Jul 10 08:28:01 UTC 2010


On 07/09/2010 03:26 PM, Jonas Meurer wrote:
> Hey again,
>
> On 09/07/2010 Milan Broz wrote:
>   
>> On 07/09/2010 09:41 AM, Γιώργος Πάλλας wrote:
>>
>>     
>>> # WARNING: other process locked internal device
>>> temporary-cryptsetup-18450, retrying remove.
>>> # WARNING: Process PID 18473 (hald-probe-volu) [PPID 1711 (hald-runner)]
>>> spying on internal device /dev/dm-4.
>>>       
>> Ha! So finally the debug code found something locking the device! :-)
>>
>> HAL _must_ _not_ open temporary-cryptsetup device.
>> It can scan final device but not the temporary one.
>> (udev/udisks have this solved, I thought hal uses the same...)
>>
>> Maybe it is not the real problem but please fix hal too here.
>>     
> I discussed that with the hal maintainer. Hal already has a workaround
> to ignore temporary-cryptsetup-* devices (in hald/linux/osspec.c). The
> problem here seems to be that hal probes /dev/dm-4, and not the
> temporary-cryptsetup device. and the workaround doesn't ignore that one.
>
> so, Giorgos, please temporarily disable hal (/etc/init.d/hal stop), and
> see whether the issue disappears. In that case, hal is the problem for
> sure.
>
> But then still the problem is, how should hal distinguish temporary
> cryptsetup devices reliably, when '/dev/dm-X' is used? Milan, is there
> any better/cheaper solution than a lookup for symlinks in /dev/mapper/*?
>
> greetings,
>  jonas
>   


Hi Jonas.

Indeed, with hal stopped, the issue disappears:

mordor:/home/gpall# cryptsetup --debug luksOpen /dev/sdb2 dataspace_crypt
# cryptsetup 1.1.2 processing "cryptsetup --debug luksOpen /dev/sdb2
dataspace_crypt"
# Locking memory.
# Allocating crypt device /dev/sdb2 context.
# Trying to open and read device /dev/sdb2.
# Initialising device-mapper backend, UDEV is enabled.
# Detected dm-crypt target of version 1.7.0.
# Timeout set to 0 miliseconds.
# Password retry count set to 3.
# Iteration time set to 1000 miliseconds.
# Password verification disabled.
# Trying to load LUKS1 crypt type from device /dev/sdb2.
# Initializing crypto backend (using secure memory).
# Reading LUKS header of size 1024 from device /dev/sdb2
# Activating volume dataspace_crypt [keyslot -1] using [none] passphrase.
# dm status dataspace_crypt  OF   [16384]
Enter passphrase for /dev/sdb2:
# Trying to open key slot 0 [1].
# Trying to open key slot 1 [3].
# Reading key slot 1 area.
# DM-UUID is CRYPT-TEMP-temporary-cryptsetup-3744
# Udev cookie 0xd4d1bcb (semid 1081344) created
# Udev cookie 0xd4d1bcb (semid 1081344) incremented
# Udev cookie 0xd4d1bcb (semid 1081344) incremented
# Udev cookie 0xd4d1bcb (semid 1081344) assigned to dm_task type 0 with
flags 0xe
# dm create temporary-cryptsetup-3744
CRYPT-TEMP-temporary-cryptsetup-3744 OF   [16384]
# temporary-cryptsetup-3744: Stacking NODE_ADD (254,4) 0:6 0660
# dm reload temporary-cryptsetup-3744  OF   [16384]
# dm resume temporary-cryptsetup-3744  OF   [16384]
# temporary-cryptsetup-3744: Stacking NODE_READ_AHEAD 256 (flags=1)
# Udev cookie 0xd4d1bcb (semid 1081344) decremented
# Udev cookie 0xd4d1bcb (semid 1081344): Waiting for zero
# Udev cookie 0xd4d1bcb (semid 1081344) destroyed
# temporary-cryptsetup-3744: read ahead is 256
# temporary-cryptsetup-3744: Setting read ahead to 256
# Udev cookie 0xd4d61a6 (semid 1114112) created
# Udev cookie 0xd4d61a6 (semid 1114112) incremented
# Udev cookie 0xd4d61a6 (semid 1114112) incremented
# Udev cookie 0xd4d61a6 (semid 1114112) assigned to dm_task type 2 with
flags 0x0
# dm remove temporary-cryptsetup-3744  OF   [16384]
# temporary-cryptsetup-3744: Stacking NODE_DEL (replaces other stacked ops)
# Udev cookie 0xd4d61a6 (semid 1114112) decremented
# Udev cookie 0xd4d61a6 (semid 1114112): Waiting for zero
# Udev cookie 0xd4d61a6 (semid 1114112) destroyed
Key slot 1 unlocked.
# Calculated device size is 167973584 sectors (RW), offset 2056.
# DM-UUID is CRYPT-LUKS1-b63c55b1055d47fb850bb733993f555b-dataspace_crypt
# Udev cookie 0xd4dca41 (semid 1146880) created
# Udev cookie 0xd4dca41 (semid 1146880) incremented
# Udev cookie 0xd4dca41 (semid 1146880) incremented
# Udev cookie 0xd4dca41 (semid 1146880) assigned to dm_task type 0 with
flags 0x0
# dm create dataspace_crypt
CRYPT-LUKS1-b63c55b1055d47fb850bb733993f555b-dataspace_crypt OF   [16384]
# dataspace_crypt: Stacking NODE_ADD (254,4) 0:6 0660
# dm reload dataspace_crypt  OF   [16384]
# dm resume dataspace_crypt  OF   [16384]
# dataspace_crypt: Stacking NODE_READ_AHEAD 256 (flags=1)
# Udev cookie 0xd4dca41 (semid 1146880) decremented
# Udev cookie 0xd4dca41 (semid 1146880): Waiting for zero
# Udev cookie 0xd4dca41 (semid 1146880) destroyed
# dataspace_crypt: read ahead is 256
# dataspace_crypt: Setting read ahead to 256
# Releasing crypt device /dev/sdb2 context.
# Releasing device-mapper backend.
# Unlocking memory.
Command successful.
mordor:/home/gpall#







More information about the pkg-cryptsetup-devel mailing list