Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Browse files Browse the repository at this point in the history
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  ubd: fix incorrect sector handling during request restart
  ps3disk: passing wrong variable to bvec_kunmap_irq()
  • Loading branch information
Linus Torvalds committed Oct 15, 2010
2 parents 8fd01d6 + 4752690 commit 264780c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ struct ubd {
struct scatterlist sg[MAX_SG];
struct request *request;
int start_sg, end_sg;
sector_t rq_pos;
};

#define DEFAULT_COW { \
Expand All @@ -187,6 +188,7 @@ struct ubd {
.request = NULL, \
.start_sg = 0, \
.end_sg = 0, \
.rq_pos = 0, \
}

/* Protected by ubd_lock */
Expand Down Expand Up @@ -1228,7 +1230,6 @@ static void do_ubd_request(struct request_queue *q)
{
struct io_thread_req *io_req;
struct request *req;
sector_t sector;
int n;

while(1){
Expand All @@ -1239,12 +1240,12 @@ static void do_ubd_request(struct request_queue *q)
return;

dev->request = req;
dev->rq_pos = blk_rq_pos(req);
dev->start_sg = 0;
dev->end_sg = blk_rq_map_sg(q, req, dev->sg);
}

req = dev->request;
sector = blk_rq_pos(req);
while(dev->start_sg < dev->end_sg){
struct scatterlist *sg = &dev->sg[dev->start_sg];

Expand All @@ -1256,10 +1257,9 @@ static void do_ubd_request(struct request_queue *q)
return;
}
prepare_request(req, io_req,
(unsigned long long)sector << 9,
(unsigned long long)dev->rq_pos << 9,
sg->offset, sg->length, sg_page(sg));

sector += sg->length >> 9;
n = os_write_file(thread_fd, &io_req,
sizeof(struct io_thread_req *));
if(n != sizeof(struct io_thread_req *)){
Expand All @@ -1272,6 +1272,7 @@ static void do_ubd_request(struct request_queue *q)
return;
}

dev->rq_pos += sg->length >> 9;
dev->start_sg++;
}
dev->end_sg = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/ps3disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static void ps3disk_scatter_gather(struct ps3_storage_device *dev,
memcpy(buf, dev->bounce_buf+offset, size);
offset += size;
flush_kernel_dcache_page(bvec->bv_page);
bvec_kunmap_irq(bvec, &flags);
bvec_kunmap_irq(buf, &flags);
i++;
}
}
Expand Down

0 comments on commit 264780c

Please sign in to comment.