patch-2.2.2 linux/kernel/sysctl.c

Next file: linux/mm/filemap.c
Previous file: linux/kernel/sched.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.1/linux/kernel/sysctl.c linux/kernel/sysctl.c
@@ -557,14 +557,19 @@
 				continue;
 			}
 			unregister_proc_table(table->child, de);
+
+			/* Don't unregister directories which still have entries.. */
+			if (de->subdir)
+				continue;
 		}
-		/* Don't unregister proc directories which still have
-		   entries... */
-		if (!((de->mode & S_IFDIR) && de->subdir)) {
-			proc_unregister(root, de->low_ino);
-			table->de = NULL;
-			kfree(de);
-		} 
+
+		/* Don't unregoster proc entries that are still being used.. */
+		if (de->count)
+			continue;
+
+		proc_unregister(root, de->low_ino);
+		table->de = NULL;
+		kfree(de);
 	}
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)