Messages in this thread Patch in this message | | | Date | Tue, 27 Jul 1999 23:44:08 +0200 | From | Jan Kara <> | Subject | Bug in ll_rw_blk.c in 2.3.10/11 |
| |
Hello.
I think I've found a bug in make_request() in ll_rw_blk.c in 2.3.10 or 11. The problem is that when access beyond the end of device is done, all flags except BH_Locked are cleared. This also means clearing of flag BH_Mapped so when you try to read the block second time, ll_rw_block() complains about not mapped buffer and does BUG()... My fix simply preserves the BH_mapped flag too but I'm not sure this is the right fix. If it is, the patch is attached.
Honza.
--- linux/drivers/block/ll_rw_blk.c Tue Jul 27 23:25:20 1999 +++ linux/drivers/block/ll_rw_blk.c Tue Jul 27 23:24:51 1999 @@ -403,7 +403,7 @@ unsigned long maxsector = (blk_size[major][MINOR(bh->b_rdev)] << 1) + 1; if (maxsector < count || maxsector - count < sector) { - bh->b_state &= (1 << BH_Lock); + bh->b_state &= (1 << BH_Lock) | (1 << BH_Mapped); /* This may well happen - the kernel calls bread() without checking the size of the device, e.g., when mounting a device. */
| |