Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40521
b: refs/heads/master
c: 5ddfe96
h: refs/heads/master
i:
  40519: d5bbca5
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Oct 31, 2006
1 parent 2f4cfb7 commit 1da1f9f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 45ec4ababe999cb95f9c0cad03b2689cb0b77a2b
refs/heads/master: 5ddfe9691c91a244e8d1be597b6428fcefd58103
24 changes: 20 additions & 4 deletions trunk/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2999,6 +2999,7 @@ void generic_make_request(struct bio *bio)
{
request_queue_t *q;
sector_t maxsector;
sector_t old_sector;
int ret, nr_sectors = bio_sectors(bio);
dev_t old_dev;

Expand Down Expand Up @@ -3027,7 +3028,7 @@ void generic_make_request(struct bio *bio)
* NOTE: we don't repeat the blk_size check for each new device.
* Stacking drivers are expected to know what they are doing.
*/
maxsector = -1;
old_sector = -1;
old_dev = 0;
do {
char b[BDEVNAME_SIZE];
Expand Down Expand Up @@ -3061,15 +3062,30 @@ void generic_make_request(struct bio *bio)
*/
blk_partition_remap(bio);

if (maxsector != -1)
if (old_sector != -1)
blk_add_trace_remap(q, bio, old_dev, bio->bi_sector,
maxsector);
old_sector);

blk_add_trace_bio(q, bio, BLK_TA_QUEUE);

maxsector = bio->bi_sector;
old_sector = bio->bi_sector;
old_dev = bio->bi_bdev->bd_dev;

maxsector = bio->bi_bdev->bd_inode->i_size >> 9;
if (maxsector) {
sector_t sector = bio->bi_sector;

if (maxsector < nr_sectors || maxsector - nr_sectors < sector) {
/*
* This may well happen - partitions are not checked
* to make sure they are within the size of the
* whole device.
*/
handle_bad_sector(bio);
goto end_io;
}
}

ret = q->make_request_fn(q, bio);
} while (ret);
}
Expand Down

0 comments on commit 1da1f9f

Please sign in to comment.