]> err.no Git - systemd/commitdiff
umount: Make sure / is remounted ro on shutdown
authorMichael Biebl <biebl@debian.org>
Sun, 24 Oct 2010 16:40:44 +0000 (18:40 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 25 Oct 2010 19:51:57 +0000 (21:51 +0200)
Increment n_failed in mount_points_list_umount() if we skip /.
Otherwise it can happen that mount_points_list_remount_read_only() is
not called in umount_all().

src/umount.c

index ca4dbc23627665c07887fee4db08ad7c51a92cbe..0081d979d9d0128fd99ffa179dcebffc943d6484 100644 (file)
@@ -400,12 +400,13 @@ static int mount_points_list_umount(MountPoint **head, bool *changed) {
         assert(head);
 
         LIST_FOREACH_SAFE(mount_point, m, n, *head) {
-                if (streq(m->path, "/"))
+                if (streq(m->path, "/")) {
+                        n_failed++;
                         continue;
+                }
 
                 /* Trying to umount. Forcing to umount if busy (only for NFS mounts) */
                 if (umount2(m->path, MNT_FORCE) == 0) {
-
                         if (changed)
                                 *changed = true;