Skip to contentSkip to conversation

2.4.11-pre1 oops in bdget() -- FIXED

DISCUSSION Mikael Pettersson 1 participant 1 message Oct 1, 2001 VFS

lore
Share & tools
lore
#0 lore raw
Quoted 9 lines · Linus Torvalds

The thing we oops on is the _old_ blksize_size[] array information for the floppy, which was loaded as a module and then unloaded - it's ugly that it doesn't clean up its copy of the blksize_size array, but the real cause for the problem is that bdget() references it before it has opened the device.

The (untested) fix is to just remove the line in bdget() that sets i_blkbits, as the thing is later set correctly in blkdev_get().

Confirmed. With the patch below I can no longer trigger the oops.

/Mikael

fs/block_dev.c renamed from fs/block_dev.c.~1~ +0 -1
@@ -345,7 +345,6 @@ struct block_device *bdget(dev_t dev)
 			inode->i_rdev = kdev;
 			inode->i_dev = kdev;
 			inode->i_bdev = new_bdev;
-			inode->i_blkbits = blksize_bits(block_size(kdev));
 			inode->i_data.a_ops = &def_blk_aops;
 			inode->i_data.gfp_mask = GFP_USER;
 			spin_lock(&bdev_lock);