Skip to contentSkip to conversation

initrd fails again in 2.5.18

PATCH New James Bottomley 1 participant 1 message May 27, 2002 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 initrd fails again in 2.5.18

The initial ramdisk fails to work with a slew of errors like:

generic_make_request: Trying to access nonexistent block-device 01:00 (2)

The problem was caused by change

kdev_t -> bdev cleanups [2/2]

which took out the ability of bdev_get_queue() to create a queue if one didn't already exist for the device. The functionality was moved to block_dev.c:do_open() where it exists within the if(!bdev->bd_openers) which the ramdisk never gets to.

The (tested) fix, I think, is to set bd_queue as part of ramdisk initialisation, which is what the attached patch does.

James Bottomley

===== drivers/block/rd.c 1.38 vs edited =====

drivers/block/rd.c +1 -0
@@ -379,6 +379,7 @@
 		rd_bdev[unit]->bd_openers++;
 		rd_bdev[unit]->bd_block_size = rd_blocksize;
 		rd_bdev[unit]->bd_inode->i_mapping->a_ops = &ramdisk_aops;
+		rd_bdev[unit]->bd_queue = BLK_DEFAULT_QUEUE(MAJOR_NR);
 	}
 
 	return 0;