summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-04-02 17:50:27 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-04-02 17:50:27 +0000
commit11f43eff651619344c782d2d628d061089a6e95e (patch)
treebb37dc83c7a38428fbe84842c3ed5ce13c335bcd
parent94e7f872772fe00e82142c6935fb53fb6ebd5234 (diff)
(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.
-rw-r--r--libdiskfs/lookup.c10
1 files changed, 8 insertions, 2 deletions
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;
}