patch-2.4.18 linux/fs/partitions/check.c

Next file: linux/fs/partitions/msdos.c
Previous file: linux/fs/ntfs/support.h
Back to the patch index
Back to the overall index

diff -Naur -X /home/marcelo/lib/dontdiff linux.orig/fs/partitions/check.c linux/fs/partitions/check.c
@@ -338,7 +338,8 @@
 	if (!unregister)
 		devfs_register_disc (dev, minor);
 	for (part = 1; part < dev->max_p; part++) {
-		if ( unregister || (dev->part[part + minor].nr_sects < 1) ) {
+		if ( unregister || (dev->part[minor].nr_sects < 1) ||
+		     (dev->part[part + minor].nr_sects < 1) ) {
 			devfs_unregister (dev->part[part + minor].de);
 			dev->part[part + minor].de = NULL;
 			continue;
@@ -383,6 +384,8 @@
 
 	dev->part[first_minor].nr_sects = size;
 	/* No such device or no minors to use for partitions */
+	if ( !size && dev->flags && (dev->flags[drive] & GENHD_FL_REMOVABLE) )
+		devfs_register_partitions (dev, first_minor, 0);
 	if (!size || minors == 1)
 		return;
 

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