All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] s390/dasd: fix kernel panic due to missing discipline function
@ 2021-05-25 12:50 Stefan Haberland
  2021-05-25 12:50 ` [PATCH 1/1] s390/dasd: add " Stefan Haberland
  2021-05-25 18:54 ` [PATCH 0/1] s390/dasd: fix kernel panic due to " Jens Axboe
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Haberland @ 2021-05-25 12:50 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Jan Hoeppner, linux-s390, Heiko Carstens,
	Vasily Gorbik, Christian Borntraeger

Hi Jens,

please apply the following patch that fixes a kernel panic in the DASD
device driver.

Stefan Haberland (1):
  s390/dasd: add missing discipline function

 drivers/s390/block/dasd_diag.c | 8 +++++++-
 drivers/s390/block/dasd_fba.c  | 8 +++++++-
 drivers/s390/block/dasd_int.h  | 1 -
 3 files changed, 14 insertions(+), 3 deletions(-)

-- 
2.25.1


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

* [PATCH 1/1] s390/dasd: add missing discipline function
  2021-05-25 12:50 [PATCH 0/1] s390/dasd: fix kernel panic due to missing discipline function Stefan Haberland
@ 2021-05-25 12:50 ` Stefan Haberland
  2021-05-25 14:21   ` Cornelia Huck
  2021-05-25 18:54 ` [PATCH 0/1] s390/dasd: fix kernel panic due to " Jens Axboe
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Haberland @ 2021-05-25 12:50 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Jan Hoeppner, linux-s390, Heiko Carstens,
	Vasily Gorbik, Christian Borntraeger

Fix crash with illegal operation exception in dasd_device_tasklet.
Commit b72949328869 ("s390/dasd: Prepare for additional path event handling")
renamed the verify_path function for ECKD but not for FBA and DIAG.
This leads to a panic when the path verification function is called for a
FBA or DIAG device.

Fix by defining a wrapper function for dasd_generic_verify_path().

Fixes: b72949328869 ("s390/dasd: Prepare for additional path event handling")

Cc: <stable@vger.kernel.org> #5.11
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
---
 drivers/s390/block/dasd_diag.c | 8 +++++++-
 drivers/s390/block/dasd_fba.c  | 8 +++++++-
 drivers/s390/block/dasd_int.h  | 1 -
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index 1b9e1442e6a5..fd42a5fffaed 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -642,12 +642,18 @@ static void dasd_diag_setup_blk_queue(struct dasd_block *block)
 	blk_queue_segment_boundary(q, PAGE_SIZE - 1);
 }
 
+static int dasd_diag_pe_handler(struct dasd_device *device,
+				__u8 tbvpm, __u8 fcsecpm)
+{
+	return dasd_generic_verify_path(device, tbvpm);
+}
+
 static struct dasd_discipline dasd_diag_discipline = {
 	.owner = THIS_MODULE,
 	.name = "DIAG",
 	.ebcname = "DIAG",
 	.check_device = dasd_diag_check_device,
-	.verify_path = dasd_generic_verify_path,
+	.pe_handler = dasd_diag_pe_handler,
 	.fill_geometry = dasd_diag_fill_geometry,
 	.setup_blk_queue = dasd_diag_setup_blk_queue,
 	.start_IO = dasd_start_diag,
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index 4789410885e4..3ad319aee51e 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -794,13 +794,19 @@ static void dasd_fba_setup_blk_queue(struct dasd_block *block)
 	blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
 }
 
+static int dasd_fba_pe_handler(struct dasd_device *device,
+			       __u8 tbvpm, __u8 fcsecpm)
+{
+	return dasd_generic_verify_path(device, tbvpm);
+}
+
 static struct dasd_discipline dasd_fba_discipline = {
 	.owner = THIS_MODULE,
 	.name = "FBA ",
 	.ebcname = "FBA ",
 	.check_device = dasd_fba_check_characteristics,
 	.do_analysis = dasd_fba_do_analysis,
-	.verify_path = dasd_generic_verify_path,
+	.pe_handler = dasd_fba_pe_handler,
 	.setup_blk_queue = dasd_fba_setup_blk_queue,
 	.fill_geometry = dasd_fba_fill_geometry,
 	.start_IO = dasd_start_IO,
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index 1c59b0e86a9f..155428bfed8a 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -297,7 +297,6 @@ struct dasd_discipline {
 	 * e.g. verify that new path is compatible with the current
 	 * configuration.
 	 */
-	int (*verify_path)(struct dasd_device *, __u8);
 	int (*pe_handler)(struct dasd_device *, __u8, __u8);
 
 	/*
-- 
2.25.1


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

* Re: [PATCH 1/1] s390/dasd: add missing discipline function
  2021-05-25 12:50 ` [PATCH 1/1] s390/dasd: add " Stefan Haberland
@ 2021-05-25 14:21   ` Cornelia Huck
  2021-05-27 15:05     ` Stefan Haberland
  0 siblings, 1 reply; 5+ messages in thread
From: Cornelia Huck @ 2021-05-25 14:21 UTC (permalink / raw)
  To: Stefan Haberland
  Cc: Jens Axboe, linux-block, Jan Hoeppner, linux-s390,
	Heiko Carstens, Vasily Gorbik, Christian Borntraeger

On Tue, 25 May 2021 14:50:06 +0200
Stefan Haberland <sth@linux.ibm.com> wrote:

> Fix crash with illegal operation exception in dasd_device_tasklet.
> Commit b72949328869 ("s390/dasd: Prepare for additional path event handling")
> renamed the verify_path function for ECKD but not for FBA and DIAG.
> This leads to a panic when the path verification function is called for a
> FBA or DIAG device.
> 
> Fix by defining a wrapper function for dasd_generic_verify_path().
> 
> Fixes: b72949328869 ("s390/dasd: Prepare for additional path event handling")
> 
> Cc: <stable@vger.kernel.org> #5.11
> Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
> Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
> ---
>  drivers/s390/block/dasd_diag.c | 8 +++++++-
>  drivers/s390/block/dasd_fba.c  | 8 +++++++-
>  drivers/s390/block/dasd_int.h  | 1 -
>  3 files changed, 14 insertions(+), 3 deletions(-)

Oops.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>

[Just to satisfy my curiosity: are there still any FBA devices around,
other than z/VM emulating a DASD frontend for FCP devices?]


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

* Re: [PATCH 0/1] s390/dasd: fix kernel panic due to missing discipline function
  2021-05-25 12:50 [PATCH 0/1] s390/dasd: fix kernel panic due to missing discipline function Stefan Haberland
  2021-05-25 12:50 ` [PATCH 1/1] s390/dasd: add " Stefan Haberland
@ 2021-05-25 18:54 ` Jens Axboe
  1 sibling, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2021-05-25 18:54 UTC (permalink / raw)
  To: Stefan Haberland
  Cc: linux-block, Jan Hoeppner, linux-s390, Heiko Carstens,
	Vasily Gorbik, Christian Borntraeger

On 5/25/21 6:50 AM, Stefan Haberland wrote:
> Hi Jens,
> 
> please apply the following patch that fixes a kernel panic in the DASD
> device driver.
> 
> Stefan Haberland (1):
>   s390/dasd: add missing discipline function
> 
>  drivers/s390/block/dasd_diag.c | 8 +++++++-
>  drivers/s390/block/dasd_fba.c  | 8 +++++++-
>  drivers/s390/block/dasd_int.h  | 1 -
>  3 files changed, 14 insertions(+), 3 deletions(-)

Applied, thanks.

-- 
Jens Axboe


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

* Re: [PATCH 1/1] s390/dasd: add missing discipline function
  2021-05-25 14:21   ` Cornelia Huck
@ 2021-05-27 15:05     ` Stefan Haberland
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Haberland @ 2021-05-27 15:05 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Jens Axboe, linux-block, Jan Hoeppner, linux-s390,
	Heiko Carstens, Vasily Gorbik, Christian Borntraeger


> [Just to satisfy my curiosity: are there still any FBA devices around,
> other than z/VM emulating a DASD frontend for FCP devices?]
>

Currently no, only emulated ones. So there are likely no "real" path
events for the virtual devices and the bug would not be triggered in the
wild.
But one could accidentally trigger it by explicitly doing a "chchp -v 1"
on the virtual path.




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

end of thread, other threads:[~2021-05-27 15:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 12:50 [PATCH 0/1] s390/dasd: fix kernel panic due to missing discipline function Stefan Haberland
2021-05-25 12:50 ` [PATCH 1/1] s390/dasd: add " Stefan Haberland
2021-05-25 14:21   ` Cornelia Huck
2021-05-27 15:05     ` Stefan Haberland
2021-05-25 18:54 ` [PATCH 0/1] s390/dasd: fix kernel panic due to " Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.