diff options
author | Karel Zak | 2012-09-18 11:22:17 +0200 |
---|---|---|
committer | Karel Zak | 2012-09-18 11:22:17 +0200 |
commit | 475c30d0614383692ed87e63b1889099757420c2 (patch) | |
tree | c87a6ed0782c8854574e9ec2e09c07aa457de13b /libmount | |
parent | rtcwake: doesn't reset wakealarm (diff) | |
download | kernel-qcow2-util-linux-475c30d0614383692ed87e63b1889099757420c2.tar.gz kernel-qcow2-util-linux-475c30d0614383692ed87e63b1889099757420c2.tar.xz kernel-qcow2-util-linux-475c30d0614383692ed87e63b1889099757420c2.zip |
libmount: detach loopdev on umount if loop option in mtab
[chroot-i486] root:/$ mount --version
mount from util-linux 2.22 (libmount 2.22.0: debug)
[chroot-i486] root:/$ losetup -a
[chroot-i486] root:/$ mount -oloop /tmp/foo_fs /tmp/bar_dir
[chroot-i486] root:/$ umount /tmp/foo_fs
[chroot-i486] root:/$ losetup -a
/dev/loop0: [2051]:387175 (/tmp/foo_fs)
Reported-by: g.esp@free.fr
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount')
-rw-r--r-- | libmount/src/context_umount.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c index 2c2975e7e..36ed435cf 100644 --- a/libmount/src/context_umount.c +++ b/libmount/src/context_umount.c @@ -616,6 +616,10 @@ int mnt_context_prepare_umount(struct libmnt_context *cxt) rc = mnt_context_prepare_helper(cxt, "umount", NULL); } + if (!rc && (cxt->user_mountflags & MNT_MS_LOOP)) + /* loop option explicitly specified in mtab, detach this loop */ + mnt_context_enable_loopdel(cxt, TRUE); + if (!rc && mnt_context_is_loopdel(cxt) && cxt->fs) { const char *src = mnt_fs_get_srcpath(cxt->fs); |