Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 504914 - sys-fs/cryptsetup - dmcrypt initscript should omit explicit loop device creation
Summary: sys-fs/cryptsetup - dmcrypt initscript should omit explicit loop device creation
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-17 22:35 UTC by Raphaël Droz
Modified: 2014-03-27 04:09 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.