2.5 INITRD + DEVFS crash
diff mbox series

Message ID 20030104041219.GA3066@gondor.apana.org.au
State New, archived
Headers show
Series
  • 2.5 INITRD + DEVFS crash
Related show

Commit Message

Herbert Xu Jan. 4, 2003, 4:12 a.m. UTC
INITRD loading fails when DEVFS is enabled in the kernel as initrd_release
calls del_gendisk which tries to free DEVFS partitions even though the
create partitions function was never called.

Comments

Jeff Garzik Jan. 4, 2003, 4:25 a.m. UTC | #1
Herbert Xu wrote:
> INITRD loading fails when DEVFS is enabled in the kernel as initrd_release
> calls del_gendisk which tries to free DEVFS partitions even though the
> create partitions function was never called.
[...]
> --- fs/partitions/check.c	3 Jan 2003 01:36:55 -0000	1.1.1.3
> +++ fs/partitions/check.c	4 Jan 2003 04:04:05 -0000
> @@ -522,7 +522,8 @@
>  	disk->io_ticks = 0;
>  	disk->time_in_queue = 0;
>  	disk->stamp = disk->stamp_idle = 0;
> -	devfs_remove_partitions(disk);
> +	if (disk->minors != 1)
> +		devfs_remove_partitions(disk);
>  	if (disk->driverfs_dev) {
>  		sysfs_remove_link(&disk->kobj, "device");
>  		sysfs_remove_link(&disk->driverfs_dev->kobj, "block");


hmmmm.   I'm not disputing the problem, but your solution sorta says to 
me that there is a reference counting problem elsewhere.  [disclaimer: 
random guess]  Maybe the initrd+devfs needs an additional reference 
increment somewhere?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch
diff mbox series

Index: fs/partitions/check.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/fs/partitions/check.c,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 check.c
--- fs/partitions/check.c	3 Jan 2003 01:36:55 -0000	1.1.1.3
+++ fs/partitions/check.c	4 Jan 2003 04:04:05 -0000
@@ -522,7 +522,8 @@ 
 	disk->io_ticks = 0;
 	disk->time_in_queue = 0;
 	disk->stamp = disk->stamp_idle = 0;
-	devfs_remove_partitions(disk);
+	if (disk->minors != 1)
+		devfs_remove_partitions(disk);
 	if (disk->driverfs_dev) {
 		sysfs_remove_link(&disk->kobj, "device");
 		sysfs_remove_link(&disk->driverfs_dev->kobj, "block");