lkml.org 
[lkml]   [1999]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectBug 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. */
\
 
 \ /
  Last update: 2005-03-22 13:53    [W:5.098 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site