diff options
-rw-r--r-- | libdiskfs/lookup.c | 10 |
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; } |