From 4d3a0887b48a59838b7c82df22d54b10aa872ef2 Mon Sep 17 00:00:00 2001 From: Thomas Veerman Date: Wed, 1 Feb 2012 11:34:40 +0000 Subject: [PATCH] AVFS: only put mount point when it was used as one 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/servers/avfs/vmnt.c b/servers/avfs/vmnt.c index a762421f3..bb3dc0746 100644 --- a/servers/avfs/vmnt.c +++ b/servers/avfs/vmnt.c @@ -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); } } -- 2.44.0