Skip to content

Commit

Permalink
xen/blkfront: fix bug in backported patch
Browse files Browse the repository at this point in the history
The backport of commit 8f5a695 ("xen/blkfront: don't take local
copy of a request from the ring page") to stable 4.4 kernel introduced
a bug when adding the needed blkif_ring_get_request() function, as
info->ring.req_prod_pvt was incremented twice now.

Fix that be deleting the now superfluous increments after calling that
function.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Juergen Gross authored and Greg Kroah-Hartman committed Dec 29, 2021
1 parent 6be3251 commit e29b328
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,6 @@ static int blkif_queue_discard_req(struct request *req)
else
ring_req->u.discard.flag = 0;

info->ring.req_prod_pvt++;

/* Copy the request to the ring page. */
*final_ring_req = *ring_req;
info->shadow[id].inflight = true;
Expand Down Expand Up @@ -711,8 +709,6 @@ static int blkif_queue_rw_req(struct request *req)
if (setup.segments)
kunmap_atomic(setup.segments);

info->ring.req_prod_pvt++;

/* Copy request(s) to the ring page. */
*final_ring_req = *ring_req;
info->shadow[id].inflight = true;
Expand Down

0 comments on commit e29b328

Please sign in to comment.