summaryrefslogtreecommitdiffstats
path: root/libmount/src/context_umount.c
diff options
context:
space:
mode:
authorRobert Schiele2014-09-18 08:09:59 +0200
committerKarel Zak2014-09-22 12:53:57 +0200
commit4fcb0f3fb806c9f37eebbb7fec39d993ac69ff99 (patch)
tree421b46a548e123493c7f4d1294548b87eff8d09a /libmount/src/context_umount.c
parentcal: `color` option documentation should match actual behaviour (diff)
downloadkernel-qcow2-util-linux-4fcb0f3fb806c9f37eebbb7fec39d993ac69ff99.tar.gz
kernel-qcow2-util-linux-4fcb0f3fb806c9f37eebbb7fec39d993ac69ff99.tar.xz
kernel-qcow2-util-linux-4fcb0f3fb806c9f37eebbb7fec39d993ac69ff99.zip
umount: read mountinfo if --detach-loop given
Don't use the optimization not to read mountinfo from commit 6a52473ecd877227f6f7da2b95da0b51593ffec1 if --detach-loop was given since we need the name of the loop device in that case and with the optimization this is not present and thus the detach operation obviously fails. Signed-off-by: Robert Schiele <rschiele@gmail.com>
Diffstat (limited to 'libmount/src/context_umount.c')
-rw-r--r--libmount/src/context_umount.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c
index 73e8214c8..6c1d9a2f4 100644
--- a/libmount/src/context_umount.c
+++ b/libmount/src/context_umount.c
@@ -254,7 +254,8 @@ static int lookup_umount_fs(struct libmnt_context *cxt)
* options for the target (e.g. helper=udisks to call /sbin/umount.udisks).
*
* So, let's use statfs() if possible (it's bad idea for --lazy/--force
- * umounts as target is probably unreachable NFS).
+ * umounts as target is probably unreachable NFS, also for --detach-loop
+ * as this additionally needs to know the name of the loop device).
*/
if (!mnt_context_is_restricted(cxt)
&& *tgt == '/'
@@ -262,6 +263,7 @@ static int lookup_umount_fs(struct libmnt_context *cxt)
&& !mnt_context_mtab_writable(cxt)
&& !mnt_context_is_force(cxt)
&& !mnt_context_is_lazy(cxt)
+ && !mnt_context_is_loopdel(cxt)
&& stat(tgt, &st) == 0 && S_ISDIR(st.st_mode)
&& !has_utab_entry(cxt, tgt)) {