diff options
author | Michael I. Bushnell <mib@gnu.org> | 1996-04-12 19:56:41 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1996-04-12 19:56:41 +0000 |
commit | 6ddbfbc7e3efd4e53097af597eea7e9296020239 (patch) | |
tree | 05ae70f53088fb1bb2b012fa3044de0ccfc7878b | |
parent | 9323d6ead727e123a8bf5601dccc780c3de53596 (diff) |
(diskfs_enter_lookup_cache): Never cache . or ..
-rw-r--r-- | libdiskfs/name-cache.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libdiskfs/name-cache.c b/libdiskfs/name-cache.c index daf54bed..a4270fe9 100644 --- a/libdiskfs/name-cache.c +++ b/libdiskfs/name-cache.c @@ -169,6 +169,13 @@ diskfs_enter_lookup_cache (struct node *dir, struct node *np, char *name) if (name_len > CACHE_NAME_LEN - 1) return; + /* Never cache . or ..; it's too much trouble to get the locking + order right. */ + if (name[0] == '.' + && (name[1] == '\0' + || (name[1] == '.' && name[2] == '\0'))) + return; + spin_lock (&cache_lock); if (lru_cache == 0) |