]> Zhao Yanbai Git Server - minix.git/commitdiff
Let FSes exit themselves upon system shutdown
authorThomas Veerman <thomas@minix3.org>
Fri, 26 Aug 2011 15:14:55 +0000 (15:14 +0000)
committerThomas Veerman <thomas@minix3.org>
Fri, 26 Aug 2011 15:17:53 +0000 (15:17 +0000)
During shutdown all processes are semi-exited and FSes are unmounted.
This semi-exit causes trouble for FUSE mounts as they still need access
to file descriptors and working directory in order to unmount.

servers/avfs/misc.c

index 53b19b533aed1913f0ae72d337bd06875fe451c0..0aee50600ad5ee9464cc8ca4e394f2af0d1f642f 100644 (file)
@@ -344,14 +344,17 @@ PUBLIC void pm_reboot()
    * will tell us about it).
    */
   for (i = 0; i < NR_PROCS; i++) {
+       rfp = &fproc[i];
+       if (rfp->fp_endpoint == NONE) continue;
+
+       /* Let FSes exit themselves */
+       if (find_vmnt(rfp->fp_endpoint) != NULL) continue;
+
        /* Don't just free the proc right away, but let it finish what it was
         * doing first */
-       rfp = &fproc[i];
-       if (rfp->fp_endpoint != NONE) {
-               lock_proc(rfp, 0);
-               free_proc(rfp, 0);
-               unlock_proc(rfp);
-       }
+       lock_proc(rfp, 0);
+       free_proc(rfp, 0);
+       unlock_proc(rfp);
   }
 
   do_sync();