Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 178699

Summary: sys-fs/cryptsetup-luks-1.0.3-r2 fails to take down dm-crypt loop devices.
Product: Gentoo Linux Reporter: Stephan Dale <bugzilla>
Component: Current packagesAssignee: Benjamin Smee (strerror) (RETIRED) <strerror>
Status: RESOLVED INVALID    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to remove "source" mappings

Description Stephan Dale 2007-05-15 23:10:59 UTC
I recently replaced cryptsetup with cryptsetup-luks-1.0.3-r2 (the only modification to config necessary was to change mount= to target=). The existing loopback files 'mounted' properly but on shutdown they could not be taken down, with the following message (from memory, so is not cut-and-paste accurate):

ioctl: LOOP_CLA_FD. Device or resource busy.

I upgraded my kernel to the latest 2.6.18-gentoo-r6 and updated the system to the latest packages in portage.

Replacing cryptsetup-luks with cryptsetup-0.1-r3 fixed the problem.

Encrypted swap went down ok.

My /etc/conf.d/cryptfs (for cryptsetup-luks) was as follows:

[begin /etc/conf.d/cryptfs]

swap=crypt-swap
source='/dev/sda7'

# dm-crypt

target='crypt-tmp'
source='/dev/loop0'
loop_file='/tmp.img'
options='-d /dev/urandom'
pre_mount='/sbin/mkreiserfs -f -f ${dev}'
post_mount='chown root:root ${mount_point}; chmod 1777 ${mount_point}'

# Loopback files

target='crypt-bn'
source='/dev/loop1'
options='-c serpent -s 256'
loop_file='/home/bn.img'

target='crypt-steph'
source='/dev/loop2'
options='-c serpent -s 256'
loop_file='/home/steph.img'

[end]

Reproducible: Always

Steps to Reproduce:
1. Replace cryptsetup with cryptsetup-luks-1.0.3-r2
2. Change mount= to target= in /etc/conf.d/cryptfs.
3. Reboot.
4. Shutdown.

Actual Results:  
dm-crypt loop devices could not be taken down, with the following message:

ioctl: LOOP_CLA_FD. Device or resource busy.

Expected Results:  
dm-crypt loop devices are taken down with no errors or warnings.
Comment 1 Stephan Dale 2007-05-17 18:08:09 UTC
I just want to make clear that when I said "I upgraded my kernel to the latest 2.6.18-gentoo-r6 and updated the system to the latest packages in portage" I meant before I installed cryptsetup-luks.
Comment 2 Markus 2007-07-04 16:38:09 UTC
Created attachment 123890 [details, diff]
patch to remove "source" mappings
Comment 3 Markus 2007-07-05 15:35:18 UTC
I missed the added target for loop... the conf needs an update.