Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135578
b: refs/heads/master
c: 1cd96c2
h: refs/heads/master
v: v3
  • Loading branch information
Boaz Harrosh authored and Jens Axboe committed Mar 26, 2009
1 parent b660fe1 commit 064f029
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 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: f028f3b2f987ebc61cef382ab7a5c449917b728e
refs/heads/master: 1cd96c242a829d52f7a5ae98f554ca9775429685
3 changes: 3 additions & 0 deletions trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,9 @@ void __blk_put_request(struct request_queue *q, struct request *req)

elv_completed_request(q, req);

/* this is a bio leak */
WARN_ON(req->bio != NULL);

/*
* Request may not have originated from ll_rw_blk. if not,
* it didn't come out of our reserved rq pools
Expand Down
2 changes: 2 additions & 0 deletions trunk/block/blk-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ static int attempt_merge(struct request_queue *q, struct request *req,
if (blk_rq_cpu_valid(next))
req->cpu = next->cpu;

/* owner-ship of bio passed from next to req */
next->bio = NULL;
__blk_put_request(q, next);
return 1;
}
Expand Down
21 changes: 4 additions & 17 deletions trunk/block/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,21 +214,10 @@ static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
return 0;
}

/*
* unmap a request that was previously mapped to this sg_io_hdr. handles
* both sg and non-sg sg_io_hdr.
*/
static int blk_unmap_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr)
{
blk_rq_unmap_user(rq->bio);
blk_put_request(rq);
return 0;
}

static int blk_complete_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr,
struct bio *bio)
{
int r, ret = 0;
int ret = 0;

/*
* fill in all the output members
Expand All @@ -253,12 +242,10 @@ static int blk_complete_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr,
ret = -EFAULT;
}

rq->bio = bio;
r = blk_unmap_sghdr_rq(rq, hdr);
if (ret)
r = ret;
blk_rq_unmap_user(bio);
blk_put_request(rq);

return r;
return ret;
}

static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
Expand Down

0 comments on commit 064f029

Please sign in to comment.