]> git.hungrycats.org Git - linux/commitdiff
[PATCH] d_vfs_flags locking fix
authorAndrew Morton <akpm@osdl.org>
Fri, 14 May 2004 12:46:33 +0000 (05:46 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 14 May 2004 12:46:33 +0000 (05:46 -0700)
Be consistent about d_vfs_flags locking: take dentry->d_lock when modifying
it.

fs/dcache.c

index c44a248ca7e5c3f88e2419ba582ec22a1fa6f904..bfa8990cdb1fc8b08ae18b3ccd5432631927232b 100644 (file)
@@ -1120,7 +1120,9 @@ void d_rehash(struct dentry * entry)
 {
        struct hlist_head *list = d_hash(entry->d_parent, entry->d_name.hash);
        spin_lock(&dcache_lock);
+       spin_lock(&entry->d_lock);
        entry->d_vfs_flags &= ~DCACHE_UNHASHED;
+       spin_unlock(&entry->d_lock);
        entry->d_bucket = list;
        hlist_add_head_rcu(&entry->d_hash, list);
        spin_unlock(&dcache_lock);