Commit 1adb7d24 authored by Pavel Emelyanov's avatar Pavel Emelyanov

mount: Umount a mountpoint when iterating

The tree should already be sorted, thus the call for umount shouldn't fail.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f0c68e73
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/mount.h>
#include "crtools.h" #include "crtools.h"
#include "types.h" #include "types.h"
...@@ -334,7 +335,12 @@ static int do_umount_one(struct mount_info *mi) ...@@ -334,7 +335,12 @@ static int do_umount_one(struct mount_info *mi)
if (!mi->parent) if (!mi->parent)
return 0; 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; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment