diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-06-13 16:29:25 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-06-13 16:29:25 +0000 |
commit | db7d4daea91e105e3859cf461d7e53b9b77454b2 (patch) | |
tree | 9bb65b95440af09e8aca63abe56970dd3360cc57 /drivers/block/ll_rw_blk.c | |
parent | 9c1c01ead627bdda9211c9abd5b758d6c687d8ac (diff) |
Merge with Linux 2.2.8.
Diffstat (limited to 'drivers/block/ll_rw_blk.c')
-rw-r--r-- | drivers/block/ll_rw_blk.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index 695fcb361..bc2ed2cac 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c @@ -392,8 +392,10 @@ void make_request(int major,int rw, struct buffer_head * bh) lock_buffer(bh); - if (blk_size[major]) - if (blk_size[major][MINOR(bh->b_rdev)] < (sector + count)>>1) { + if (blk_size[major]) { + unsigned long maxsector = (blk_size[major][MINOR(bh->b_rdev)] << 1) + 1; + + if (maxsector < count || maxsector - count < sector) { bh->b_state &= (1 << BH_Lock); /* This may well happen - the kernel calls bread() without checking the size of the device, e.g., @@ -406,6 +408,7 @@ void make_request(int major,int rw, struct buffer_head * bh) blk_size[major][MINOR(bh->b_rdev)]); goto end_io; } + } rw_ahead = 0; /* normal case; gets changed below for READA/WRITEA */ switch (rw) { |