namespace: unmount old /dev under our new private /dev (#3254)

Drop all dangling old /dev mounts before mounting a new private /dev tree.
This commit is contained in:
topimiettinen
2016-05-14 12:46:23 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent 2099b3e993
commit 9e5f825280
+2
View File
@@ -237,6 +237,8 @@ static int mount_dev(BindMount *m) {
*/
(void) mkdir_p_label(m->path, 0755);
/* Unmount everything in old /dev */
umount_recursive(m->path, 0);
if (mount(dev, m->path, NULL, MS_MOVE, NULL) < 0) {
r = -errno;
goto fail;