summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-05-08 13:32:20 +0000
committerMiles Bader <miles@gnu.org>1995-05-08 13:32:20 +0000
commit0d4c9552d7f837afa7b28a86363434da2d77ce7a (patch)
tree0c4677cbf00e41e20a945d86c076d8e0b1752d53
parent0c8ce8707b32f1a39f59034fe73482048dd018c9 (diff)
(diskfs_lookup): When looping back to try_again: because we're looking up
"..", be sure and trash the mapping we made of the directory's pager -- otherwise the reference to the pager never gets dropped and we can never free the node. (diskfs_lookup): ds->type was being compared to LOOKING, which value it can never have. Compare ds->stat against LOOKING instead.
-rw-r--r--ufs/dir.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ufs/dir.c b/ufs/dir.c
index 83eae80d..aeaa5abc 100644
--- a/ufs/dir.c
+++ b/ufs/dir.c
@@ -95,7 +95,7 @@ diskfs_lookup (struct node *dp, char *name, enum lookup_type type,
struct node *np = 0;
int retry_dotdot = 0;
memory_object_t memobj;
- vm_address_t buf;
+ vm_address_t buf = 0;
vm_size_t buflen;
int blockaddr;
int idx;
@@ -124,6 +124,11 @@ diskfs_lookup (struct node *dp, char *name, enum lookup_type type,
ds->mapbuf = 0;
ds->mapextent = 0;
}
+ if (buf)
+ {
+ vm_deallocate (mach_task_self (), buf, buflen);
+ buf = 0;
+ }
if (ds && (type == CREATE || type == RENAME))
ds->stat = LOOKING;
@@ -245,7 +250,7 @@ diskfs_lookup (struct node *dp, char *name, enum lookup_type type,
goto out;
}
- if ((type == CREATE || type == RENAME) && !np && ds && ds->type == LOOKING)
+ if ((type == CREATE || type == RENAME) && !np && ds && ds->stat == LOOKING)
{
/* We didn't find any room, so mark ds to extend the dir */
ds->type = CREATE;