Skip to contentSkip to conversation

Fix DRBD regression

PATCH New Philipp Reisner 2 participants 3 messages Jun 25, 2014

Subsystems (2)
lore
Share & tools
lore

Philipp Reisner

author maintainer
#0 lore raw

PATCH 1/1 Fix DRBD regression

Hi Jens,

this patch is intended for 3.16-rc3 (or -rc4). The issue was introduced with the 3.16 merge window, while adding support for REQ_DISCARD to DRBD. Please see the commit message for more details.

best regards,
Phil

Lars Ellenberg (1):
drbd: fix NULL pointer deref in blk_add_request_payload

 drivers/block/drbd/drbd_receiver.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1
author maintainer
#1 lore raw

PATCH 1/1 drbd: fix NULL pointer deref in blk_add_request_payload

From: Lars Ellenberg <[email protected]>

Discards don't have any payload.
But the scsi layer still expects a bio_vec it can use internally, see sd_setup_discard_cmnd() and blk_add_request_payload().

---
 drivers/block/drbd/drbd_receiver.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/block/drbd/drbd_receiver.c +4 -1
index b6c8aaf..5b17ec8 100644
@@ -1337,8 +1337,11 @@ int drbd_submit_peer_request(struct drbd_device *device,
 		return 0;
 	}
 
+	/* Discards don't have any payload.
+	 * But the scsi layer still expects a bio_vec it can use internally,
+	 * see sd_setup_discard_cmnd() and blk_add_request_payload(). */
 	if (peer_req->flags & EE_IS_TRIM)
-		nr_pages = 0; /* discards don't have any payload. */
+		nr_pages = 1;
 
 	/* In most cases, we will only need one bio.  But in case the lower
 	 * level restrictions happen to be different at this offset on this
Signature · 1 line
1.9.1
maintainer Applied
#2 lore raw

Re: [PATCH] drbd: fix NULL pointer deref in blk_add_request_payload

Quoted 8 lines · Philipp Reisner

From: Lars Ellenberg <[email protected]>

Discards don't have any payload.
But the scsi layer still expects a bio_vec it can use internally, see sd_setup_discard_cmnd() and blk_add_request_payload().

Applied, thanks.

Signature · 1 line
Jens Axboe