public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix DRBD regression
@ 2014-06-25 15:52 Philipp Reisner
  2014-06-25 15:52 ` [PATCH] drbd: fix NULL pointer deref in blk_add_request_payload Philipp Reisner
  0 siblings, 1 reply; 3+ messages in thread
From: Philipp Reisner @ 2014-06-25 15:52 UTC (permalink / raw)
  To: linux-kernel, Jens Axboe; +Cc: drbd-dev

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(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] drbd: fix NULL pointer deref in blk_add_request_payload
  2014-06-25 15:52 [PATCH] Fix DRBD regression Philipp Reisner
@ 2014-06-25 15:52 ` Philipp Reisner
  2014-06-25 15:56   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Philipp Reisner @ 2014-06-25 15:52 UTC (permalink / raw)
  To: linux-kernel, Jens Axboe; +Cc: drbd-dev

From: Lars Ellenberg <lars.ellenberg@linbit.com>

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().

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
---
 drivers/block/drbd/drbd_receiver.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index b6c8aaf..5b17ec8 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -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
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drbd: fix NULL pointer deref in blk_add_request_payload
  2014-06-25 15:52 ` [PATCH] drbd: fix NULL pointer deref in blk_add_request_payload Philipp Reisner
@ 2014-06-25 15:56   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2014-06-25 15:56 UTC (permalink / raw)
  To: Philipp Reisner, linux-kernel; +Cc: drbd-dev

On 06/25/2014 09:52 AM, Philipp Reisner wrote:
> From: Lars Ellenberg <lars.ellenberg@linbit.com>
> 
> 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().
> 
> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-25 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-25 15:52 [PATCH] Fix DRBD regression Philipp Reisner
2014-06-25 15:52 ` [PATCH] drbd: fix NULL pointer deref in blk_add_request_payload Philipp Reisner
2014-06-25 15:56   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox