Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 182031 - sys-apps/util-linux - /etc/init.d/crypto-loop stop fails on cryptoloop based swaps
Summary: sys-apps/util-linux - /etc/init.d/crypto-loop stop fails on cryptoloop based ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-14 14:47 UTC by Petr Pisar
Modified: 2007-10-05 23:26 UTC (History)
0 users

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


Attachments
/etc/init.d/crypto-loop (crypto-loop.diff,466 bytes, patch)
2007-06-14 14:48 UTC, Petr Pisar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisar 2007-06-14 14:47:17 UTC
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 Petr Pisar 2007-06-14 14:48:48 UTC
Created attachment 122032 [details, diff]
/etc/init.d/crypto-loop

Attemp to swapoff loop device which failed on umount
Comment 2 SpanKY gentoo-dev 2007-10-05 23:26:57 UTC
added to 2.13-r2 / 2.12r-r8, thanks !