diff options
author | Jan Beulich <JBeulich@suse.com> | 2013-03-11 05:39:55 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-03-18 16:31:22 -0400 |
commit | 0e5e098ac22dae38f957e951b70d3cf73beff0f7 (patch) | |
tree | 741db5f87eb16bc381bb171f96aac92e55b9c784 /drivers | |
parent | 986cacbd26abe5d498be922cd6632f1ec376c271 (diff) |
xen-blkback: fix dispatch_rw_block_io() error path
Commit 7708992 ("xen/blkback: Seperate the bio allocation and the bio
submission") consolidated the pendcnt updates to just a single write,
neglecting the fact that the error path relied on it getting set to 1
up front (such that the decrement in __end_block_io_op() would actually
drop the count to zero, triggering the necessary cleanup actions).
Also remove a misleading and a stale (after said commit) comment.
CC: stable@vger.kernel.org
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/xen-blkback/blkback.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index eaccc222a1dc..477a17c20820 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c | |||
@@ -1001,13 +1001,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, | |||
1001 | bio->bi_end_io = end_block_io_op; | 1001 | bio->bi_end_io = end_block_io_op; |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | /* | ||
1005 | * We set it one so that the last submit_bio does not have to call | ||
1006 | * atomic_inc. | ||
1007 | */ | ||
1008 | atomic_set(&pending_req->pendcnt, nbio); | 1004 | atomic_set(&pending_req->pendcnt, nbio); |
1009 | |||
1010 | /* Get a reference count for the disk queue and start sending I/O */ | ||
1011 | blk_start_plug(&plug); | 1005 | blk_start_plug(&plug); |
1012 | 1006 | ||
1013 | for (i = 0; i < nbio; i++) | 1007 | for (i = 0; i < nbio; i++) |
@@ -1035,6 +1029,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, | |||
1035 | fail_put_bio: | 1029 | fail_put_bio: |
1036 | for (i = 0; i < nbio; i++) | 1030 | for (i = 0; i < nbio; i++) |
1037 | bio_put(biolist[i]); | 1031 | bio_put(biolist[i]); |
1032 | atomic_set(&pending_req->pendcnt, 1); | ||
1038 | __end_block_io_op(pending_req, -EINVAL); | 1033 | __end_block_io_op(pending_req, -EINVAL); |
1039 | msleep(1); /* back off a bit */ | 1034 | msleep(1); /* back off a bit */ |
1040 | return -EIO; | 1035 | return -EIO; |