]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/dcache.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[karo-tx-linux.git] / fs / dcache.c
index 96655f4f45749e530cee80a32c36fb8e6061164b..5aa53bc056bada2af9c3c6040498abcb9a3a3856 100644 (file)
@@ -472,7 +472,7 @@ relock:
         * inform the fs via d_prune that this dentry is about to be
         * unhashed and destroyed.
         */
-       if (dentry->d_flags & DCACHE_OP_PRUNE)
+       if ((dentry->d_flags & DCACHE_OP_PRUNE) && !d_unhashed(dentry))
                dentry->d_op->d_prune(dentry);
 
        dentry_lru_del(dentry);
@@ -727,6 +727,14 @@ restart:
        hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
                spin_lock(&dentry->d_lock);
                if (!dentry->d_lockref.count) {
+                       /*
+                        * inform the fs via d_prune that this dentry
+                        * is about to be unhashed and destroyed.
+                        */
+                       if ((dentry->d_flags & DCACHE_OP_PRUNE) &&
+                           !d_unhashed(dentry))
+                               dentry->d_op->d_prune(dentry);
+
                        __dget_dlock(dentry);
                        __d_drop(dentry);
                        spin_unlock(&dentry->d_lock);
@@ -911,7 +919,8 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
                         * inform the fs that this dentry is about to be
                         * unhashed and destroyed.
                         */
-                       if (dentry->d_flags & DCACHE_OP_PRUNE)
+                       if ((dentry->d_flags & DCACHE_OP_PRUNE) &&
+                           !d_unhashed(dentry))
                                dentry->d_op->d_prune(dentry);
 
                        dentry_lru_del(dentry);