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

Bug 504914

Summary: sys-fs/cryptsetup - dmcrypt initscript should omit explicit loop device creation
Product: Gentoo Linux Reporter: Raphaël Droz <raphael.droz+floss>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Raphaël Droz 2014-03-17 22:35:56 UTC
It seems that cryptsetup (for some times) is able to allocate (or trigger the allocation) of needed loop devices automatically.
In such a case, a luksOpen failure won't left useless allocated loop devices.


Reproducible: Always

Steps to Reproduce:
1. create a luks volume on a regular file
2. configure it in /etc/crypttab
3. when dmcrypt starts, skip it (^D)
Actual Results:  
an allocated loop device has been created

Expected Results:  
the loop devices table should stay clean

After this test, if you:
- restart dmcrypt and type a correct password : failure (about wrong size loop device or something like this)
- restart dmcrypt and type a correct password : this should (finally) work

The leftover loop devices and consequent failures due to wrong loop allocations could be avoided, at least with some version of cryptsetup and/or some kernel version and/or some kernel options and this should be the preferred solution.
Comment 1 SpanKY gentoo-dev 2014-03-27 04:09:23 UTC
this is already doable with the current code.

instead of doing:
mount='crypt-loop-home'
source='/dev/loop0'
loop_file='/mnt/x'

do:
mount='crypt-loop-home'
source='/mnt/x'

we don't want to delete the existing losetup support since it'd break support with older kernels which lack automatic loop device creation.