]> Zhao Yanbai Git Server - minix.git/commitdiff
AVFS: only put mount point when it was used as one
authorThomas Veerman <thomas@minix3.org>
Wed, 1 Feb 2012 11:34:40 +0000 (11:34 +0000)
committerThomas Veerman <thomas@minix3.org>
Wed, 1 Feb 2012 13:22:53 +0000 (13:22 +0000)
When a mount operation fails and the FS exits, free_proc could try and
clean up resources associated with the mount point before the mount
thread itself can do that. However, the clean up procedure should only
clean up resources that were actually in use.

servers/avfs/vmnt.c

index a762421f33b2b72413cebc286e424a1491758b8e..bb3dc0746705a4f1ad746eaa4108ca55ae9ade91 100644 (file)
@@ -169,7 +169,11 @@ PUBLIC void vmnt_unmap_by_endpt(endpoint_t proc_e)
   if ((vmp = find_vmnt(proc_e)) != NULL) {
        fs_cancel(vmp);
        invalidate_filp_by_endpt(proc_e);
-       put_vnode(vmp->m_mounted_on);
+       if (vmp->m_mounted_on) {
+               /* Only put mount point when it was actually used as mount
+                * point. That is, the mount was succesful. */
+               put_vnode(vmp->m_mounted_on);
+       }
        clear_vmnt(vmp);
   }
 }