summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/name-cache.c7
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)