From 11f43eff651619344c782d2d628d061089a6e95e Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 2 Apr 1996 17:50:27 +0000 Subject: (diskfs_lookup): When doing diskfs_checkdirmod check, don't return success when we should return ENOENT, just because checkdirmod won. Also enter successful lookups for CREATE or LOOKUP in the name cache. --- libdiskfs/lookup.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libdiskfs') diff --git a/libdiskfs/lookup.c b/libdiskfs/lookup.c index e2ee538c..03c140be 100644 --- a/libdiskfs/lookup.c +++ b/libdiskfs/lookup.c @@ -73,7 +73,7 @@ diskfs_lookup (struct node *dp, struct dirstat *ds, struct protid *cred) { - error_t err; + error_t err, err2; if (type == REMOVE || type == RENAME) assert (np); @@ -113,8 +113,14 @@ diskfs_lookup (struct node *dp, if (type == RENAME || (type == CREATE && err == ENOENT) || (type == REMOVE && err != ENOENT)) - err = diskfs_checkdirmod (dp, *np, cred); + { + err2 = diskfs_checkdirmod (dp, *np, cred); + return err2; + } + if ((type == LOOKUP || type == CREATE) && !err && np) + diskfs_enter_cache (dp, *np, name); + return err; } -- cgit v1.2.3