]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/notify/fsnotify.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / fs / notify / fsnotify.c
index 20dc218707ca59afc4c5b42de6cd7d614ca49340..79b47cbb5cd82e8e89bf96de095bf76bcd2c0c47 100644 (file)
@@ -59,7 +59,7 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)
        /* determine if the children should tell inode about their events */
        watched = fsnotify_inode_watches_children(inode);
 
-       spin_lock(&dcache_lock);
+       spin_lock(&inode->i_lock);
        /* run all of the dentries associated with this inode.  Since this is a
         * directory, there damn well better only be one item on this list */
        list_for_each_entry(alias, &inode->i_dentry, d_alias) {
@@ -68,19 +68,21 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)
                /* run all of the children of the original inode and fix their
                 * d_flags to indicate parental interest (their parent is the
                 * original inode) */
+               spin_lock(&alias->d_lock);
                list_for_each_entry(child, &alias->d_subdirs, d_u.d_child) {
                        if (!child->d_inode)
                                continue;
 
-                       spin_lock(&child->d_lock);
+                       spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED);
                        if (watched)
                                child->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED;
                        else
                                child->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED;
                        spin_unlock(&child->d_lock);
                }
+               spin_unlock(&alias->d_lock);
        }
-       spin_unlock(&dcache_lock);
+       spin_unlock(&inode->i_lock);
 }
 
 /* Notify this dentry's parent about a child's events. */