patch-2.1.132 linux/fs/dcache.c

Next file: linux/fs/ext2/file.c
Previous file: linux/fs/coda/upcall.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.131/linux/fs/dcache.c linux/fs/dcache.c
@@ -161,17 +161,17 @@
 
 /*
  * Try to invalidate the dentry if it turns out to be
- * possible. If there are other users of the dentry we
- * can't invalidate it.
+ * possible. If there are other dentries that can be
+ * reached through this one we can't delete it.
  */
 int d_invalidate(struct dentry * dentry)
 {
 	/* Check whether to do a partial shrink_dcache */
-	if (!list_empty(&dentry->d_subdirs))
+	if (!list_empty(&dentry->d_subdirs)) {
 		shrink_dcache_parent(dentry);
-
-	if (dentry->d_count != 1)
-		return -EBUSY;
+		if (!list_empty(&dentry->d_subdirs))
+			return -EBUSY;
+	}
 
 	d_drop(dentry);
 	return 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov