Automatic deletion of loopback device upon umount?

Florian Fainelli florian at alphacore.org
Fri Apr 6 08:41:54 UTC 2012


Hi Harald,

Le 04/06/12 08:20, ralda at gmx.de a écrit :
> Hi Florian !
>
>> 1) loopback mount "foo" to mount /bar
>> 2) umount /bar
>> 3) append new files and re-generate the "foo" cramfs image
>> 4) loopback mount "foo" to mount /bar
>> 5) the contents of /bar are the same as in 1) and not 3)
>> Obviously using umount -d in 2) fixes the issue, but I was wondering
>> whether it would not be preferable to unconditionnaly delete the
>> loopback device upon umount? util-linux does this actually, so other
>> users might also be puzzled by such a case.
> I hit that too, some time ago, not cramfs but squashfs and ISO images.
> That was the reason I added an "alias umount='umount -d'" to
> my /etc/profile and added the "-d" to all umounts in scripts.
>
> IMHO it would be better to reverse definition of the "-d" option to
> umount and do NOT delete the loop device if option gets specified and
> drop/delete it in the default case.
I think this would be even more confusing, and make busybox no longer 
conform to util-linux' behavior. I just sent a patch which just 
unconditionally deletes the loopback device, so we have the exact same 
behavior as util-linux' umount.
--
Florian


More information about the busybox mailing list