X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;ds=sidebyside;f=fs%2Fnotify%2Ffsnotify.c;h=79b47cbb5cd82e8e89bf96de095bf76bcd2c0c47;hb=d20056032e20061db6583f517a4d3ea4492a94f1;hp=20dc218707ca59afc4c5b42de6cd7d614ca49340;hpb=2ade0c1d9d93b7642212657ef76f4a1e30233711;p=~andy%2Flinux diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index 20dc218707c..79b47cbb5cd 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c @@ -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. */