summaryrefslogtreecommitdiff
path: root/ufs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-07-21 21:51:25 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-07-21 21:51:25 +0000
commit9b7b5a29f5a8a10f96ce1d2737e1c86f1254b4f3 (patch)
tree23836277ee1488fae377299a6dfd7551653a7b7c /ufs
parentc932385dfcb5ff1d4628e5b6fdb30c49988647ed (diff)
(diskfs_get_filemap): Free initial reference created by pager_create.
Diffstat (limited to 'ufs')
-rw-r--r--ufs/pager.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ufs/pager.c b/ufs/pager.c
index 52e77f05..139e5723 100644
--- a/ufs/pager.c
+++ b/ufs/pager.c
@@ -459,8 +459,16 @@ diskfs_get_filemap (struct node *np)
upi->p = pager_create (upi, pager_bucket,
MAY_CACHE, MEMORY_OBJECT_COPY_DELAY);
np->dn->fileinfo = upi;
+ right = pager_get_port (np->dn->fileinfo->p);
+ ports_port_deref (np->dn->fileinfo->p);
}
- right = pager_get_port (np->dn->fileinfo->p);
+ else
+ /* There is a race condition here. If there are no references
+ to NP->dn->fileinfo->p, then the clean routine might be
+ blocked trying to get into node2pagelock, and this call is
+ invalid. XXX */
+ right = pager_get_port (np->dn->fileinfo->p);
+
spin_unlock (&node2pagelock);
mach_port_insert_right (mach_task_self (), right, right,