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

Bug 290629

Summary: sys-fs/cryptsetup: manually opened devices are not closed, causing sys-fs/lvm2 "read failed" on shutdown
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: proxy-maint
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: screen shot

Description Toralf Förster gentoo-dev 2009-10-26 20:37:13 UTC
While helping w/ http://www.faulhammer.org/archiv-mainmenu-31/35-gentoo/307-testers-wanted-for-x86 I observed an issue (see attached photo).


Reproducible: Always

Steps to Reproduce:
1. boot my ThinkPad T400 with "reboot=pci init 2"
2. modprobe dm-crypt
3. cryptsetup luksOpen /dev/sdb2 media
4. mount -o noatime /dev/mapper/media /mnt/media
5. umount /mnt/media
6. reboot
Comment 1 Toralf Förster gentoo-dev 2009-10-26 20:37:55 UTC
Created attachment 208351 [details]
screen shot
Comment 2 Toralf Förster gentoo-dev 2009-10-26 21:03:25 UTC
important to reproduce it : use an external USB drive, plug it in after login as root, plug out it before reboot
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-10-30 19:01:04 UTC
if, right before you reboot, you shutdown the luks, does the problem go away?
I'm thinking it's due to dm-crypt mappings not being removed, and then when device-mapper tries to finally stop, those mappings still exist.
Comment 4 Toralf Förster gentoo-dev 2009-10-31 10:45:00 UTC
(In reply to comment #3)
> if, right before you reboot, you shutdown the luks, does the problem go away?
yes, luksClose removes thuis issue

Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-11-04 07:29:58 UTC
This is not an LVM problem then. The dm-crypt scripts should probably be closing ALL dm-crypt devices, not just those registered in /etc/conf.d/dm-crypt.

vapier: ACK on closing all dm-crypt devices?
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-08-03 18:17:18 UTC
vapier: reping
Comment 7 SpanKY gentoo-dev 2011-01-07 23:32:19 UTC
yes, that makes sense