From 1adb7d241687206b8de0b45cba0c791362136f3d Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Wed, 27 Jun 2012 20:57:38 +0400 Subject: [PATCH] mount: Umount a mountpoint when iterating The tree should already be sorted, thus the call for umount shouldn't fail. Signed-off-by: Pavel Emelyanov --- mount.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mount.c b/mount.c index afd3b9f43..91066c66c 100644 --- a/mount.c +++ b/mount.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "crtools.h" #include "types.h" @@ -334,7 +335,12 @@ static int do_umount_one(struct mount_info *mi) if (!mi->parent) return 0; - pr_debug("\tUmounting %s\n", mi->mountpoint); + if (umount(mi->mountpoint)) { + pr_perror("Can't umount at %s", mi->mountpoint); + return -1; + } + + pr_info("Umounted at %s\n", mi->mountpoint); return 0; }