Bug 182031 - sys-apps/util-linux - /etc/init.d/crypto-loop stop fails on cryptoloop based swaps
Bug#: 182031 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: minor Priority: P2
Resolution: FIXED Assigned To: base-system@gentoo.org Reported By: petr.pisar@atlas.cz
Component: Core system
URL: 
Summary: sys-apps/util-linux - /etc/init.d/crypto-loop stop fails on cryptoloop based swaps
Keywords:  
Status Whiteboard: 
Opened: 2007-06-14 14:47 0000
Description:   Opened: 2007-06-14 14:47 0000
Stopping crypto-loop assumes that all loop devices are mounted. At first it
tries to umount them and then to destroy the loop disk via losetup -d. If the
losetup -d failed, the complete script terminates with error.

But if the loop device is used for swapping and then it's not possible to
umount and to destroy it.

Reproducible: Always

Steps to Reproduce:
1. Append following line into /etc/fstab:
  /dev/hdaN  none  swap  sw,loop=/dev/loop1,encryption=twofish
2. swapon -a
3. /etc/init.d/crypto-loop stop

Actual Results:  
The script failed

Expected Results:  
The script should cope with other loop devices.

The crypto-loop script is schisofrenic. Start phase works only on devices
defined in /etc/conf.d/crypto-loop but the stop phase processes all loop
devices.

I understand the motivation (deleting old encrypted devices that have been
removed from config file), but contemporal access is suboptimal.

------- Comment #1 From Petr Pisar 2007-06-14 14:48:48 0000 -------
Created an attachment (id=122032) [details]
/etc/init.d/crypto-loop

Attemp to swapoff loop device which failed on umount

------- Comment #2 From SpanKY 2007-10-05 23:26:57 0000 -------
added to 2.13-r2 / 2.12r-r8, thanks !