<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>182031</bug_id>
          
          <creation_ts>2007-06-14 14:47 0000</creation_ts>
          <short_desc>sys-apps/util-linux - /etc/init.d/crypto-loop stop fails on cryptoloop based swaps</short_desc>
          <delta_ts>2007-10-05 23:26:57 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Core system</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>petr.pisar@atlas.cz</reporter>
          <assigned_to>base-system@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>petr.pisar@atlas.cz</who>
            <bug_when>2007-06-14 14:47:17 0000</bug_when>
            <thetext>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&apos;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.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>petr.pisar@atlas.cz</who>
            <bug_when>2007-06-14 14:48:48 0000</bug_when>
            <thetext>Created an attachment (id=122032)
/etc/init.d/crypto-loop

Attemp to swapoff loop device which failed on umount</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-10-05 23:26:57 0000</bug_when>
            <thetext>added to 2.13-r2 / 2.12r-r8, thanks !</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>122032</attachid>
            <date>2007-06-14 14:48 0000</date>
            <desc>/etc/init.d/crypto-loop</desc>
            <filename>crypto-loop.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIC9ldGMvaW5pdC5kL2NyeXB0by1sb29wLm9yaWcJMjAwNy0wNi0xNCAxNjoyMToyMy4wMDAw
MDAwMDAgKzAyMDAKKysrIC9ldGMvaW5pdC5kL2NyeXB0by1sb29wCTIwMDctMDYtMTQgMTY6MTk6
MjcuMDAwMDAwMDAwICswMjAwCkBAIC01MSw3ICs1MSw4IEBACiAJZm9yIGxvb3AgaW4gJChscyAv
ZGV2L2xvb3BbMC05XSkgOyBkbwogCQlsb3NldHVwICIke2xvb3B9IiAmPiAvZGV2L251bGwKIAkJ
aWYgW1sgJD8gPT0gMCBdXSA7IHRoZW4KLQkJCXVtb3VudCAke2xvb3B9ICY+L2Rldi9udWxsCisJ
CQl1bW91bnQgJHtsb29wfSAmPi9kZXYvbnVsbCB8fCBcCisJCQkJc3dhcG9mZiAiJHtsb29wfSIg
Jj4vZGV2L251bGwKIAkJCWlmICEgL3NiaW4vbG9zZXR1cCAtZCAke2xvb3B9ICY+IC9kZXYvbnVs
bCA7IHRoZW4KIAkJCQlld2FybiAiRmFpbHVyZSBkZWNvbmZpZ3VyaW5nICR7bG9vcH0uIgogCQkJ
CXN0YXR1cz0xCg==
</data>        

          </attachment>
    </bug>

</bugzilla>