From 6ddbfbc7e3efd4e53097af597eea7e9296020239 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 12 Apr 1996 19:56:41 +0000 Subject: (diskfs_enter_lookup_cache): Never cache . or .. --- libdiskfs/name-cache.c | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- cgit v1.2.3