Skip to contentSkip to conversation

xen/blkfront: fix bug in backported patch

PATCH Applied Juergen Gross 3 participants 5 messages Dec 23, 2021 – Dec 27, 2021

Subsystems (4)
lore
Share & tools
lore

Juergen Gross

author maintainer
#0 lore raw

PATCH 1/1 xen/blkfront: fix bug in backported patch

The backport of commit 8f5a695d99000fc ("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.

---
 drivers/block/xen-blkfront.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/block/xen-blkfront.c +0 -4
index 1e44b7880200..ae2c47e99c88 100644
@@ -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;
@@ -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;
Signature · 1 line
2.26.2
#1 lore raw
Quoted 5 lines · Juergen Gross

The backport of commit 8f5a695d99000fc ("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.

Quoted 7 lines

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

---
 drivers/block/xen-blkfront.c | 4 ----
 1 file changed, 4 deletions(-)

So this is only needed in 4.4.y? No other backports were incorrect?

thanks,

greg k-h

author maintainer
#2 lore raw
Quoted 9 lines · Greg KH
Quoted 8 lines · Juergen Gross

The backport of commit 8f5a695d99000fc ("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.

Quoted 6 lines
Quoted 4 lines
---
  drivers/block/xen-blkfront.c | 4 ----
  1 file changed, 4 deletions(-)

So this is only needed in 4.4.y? No other backports were incorrect?

Yes. 4.4 only.

Juergen

#3 lore raw
Quoted 10 lines · Juergen Gross
Quoted 9 lines · Greg KH
Quoted 8 lines · Juergen Gross

The backport of commit 8f5a695d99000fc ("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.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
---
  drivers/block/xen-blkfront.c | 4 ----
  1 file changed, 4 deletions(-)

So this is only needed in 4.4.y? No other backports were incorrect?

Yes. 4.4 only.

Great, now queued up, thanks.

greg k-h

maintainer Applied
#4 lore raw

Patch "xen/blkfront: fix bug in backported patch" has been added to the 4.4-stable tree

In reply to Juergen Gross

This is a note to let you know that I've just added the patch titled

xen/blkfront: fix bug in backported patch

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
xen-blkfront-fix-bug-in-backported-patch.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From [email protected] Mon Dec 27 13:38:43 2021
From: Juergen Gross <[email protected]>
Date: Thu, 23 Dec 2021 11:53:08 +0100
Subject: xen/blkfront: fix bug in backported patch
To: [email protected]
Cc: [email protected], Juergen Gross <[email protected]>
Message-ID: <[email protected]>

From: Juergen Gross <[email protected]>

The backport of commit 8f5a695d99000fc ("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.

---
 drivers/block/xen-blkfront.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/block/xen-blkfront.c +0 -4
@@ -493,8 +493,6 @@ static int blkif_queue_discard_req(struc
 	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;
@@ -711,8 +709,6 @@ static int blkif_queue_rw_req(struct 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;

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/xen-blkfront-fix-bug-in-backported-patch.patch