]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
umount: Try unmounting even if remounting read-only failed
authorJan Janssen <medhefgo@web.de>
Thu, 8 Mar 2018 17:46:58 +0000 (18:46 +0100)
committerJan Janssen <medhefgo@web.de>
Mon, 12 Mar 2018 17:32:26 +0000 (18:32 +0100)
In the case of some api filesystems remounting read-only fails
while unmounting succeeds.

src/core/umount.c

index 9770bdb1da6a212c27a46d7b615f4ba32c3c6587..40153defe5d691dc3047dc239c8b3357dffe2b95 100644 (file)
@@ -519,16 +519,19 @@ static int mount_points_list_umount(MountPoint **head, bool *changed) {
                          * somehwere else via a bind mount. If we
                          * explicitly remount the super block of that
                          * alias read-only we hence should be
-                         * relatively safe regarding keeping dirty an fs
+                         * relatively safe regarding keeping a dirty fs
                          * we cannot otherwise see.
                          *
                          * Since the remount can hang in the instance of
                          * remote filesystems, we remount asynchronously
-                         * and skip the subsequent umount if it fails */
+                         * and skip the subsequent umount if it fails. */
                         if (remount_with_timeout(m) < 0) {
-                                if (nonunmountable_path(m->path))
+                                /* Remount failed, but try unmounting anyway,
+                                 * unless this is a mount point we want to skip. */
+                                if (nonunmountable_path(m->path)) {
                                         n_failed++;
-                                continue;
+                                        continue;
+                                }
                         }
                 }