Commit b649d7fe authored by Stefan Haberland's avatar Stefan Haberland Committed by sanglipeng
Browse files

s390/dasd: add missing discipline function

stable inclusion
from stable-v5.10.175
commit aa8579bc084673c651204f7cd0d6308a47dffc16
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8711T

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=aa8579bc084673c651204f7cd0d6308a47dffc16



--------------------------------

commit c0c8a839 upstream.

Fix crash with illegal operation exception in dasd_device_tasklet.
Commit b7294932 ("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: b7294932 ("s390/dasd: Prepare for additional path event handling")
Cc: <stable@vger.kernel.org> #5.11
Reviewed-by: default avatarJan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: default avatarStefan Haberland <sth@linux.ibm.com>
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
Link: https://lore.kernel.org/r/20210525125006.157531-2-sth@linux.ibm.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent e840357a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -642,12 +642,17 @@ 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)
{
	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,
+6 −1
Original line number Diff line number Diff line
@@ -803,13 +803,18 @@ 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)
{
	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,
+0 −1
Original line number Diff line number Diff line
@@ -298,7 +298,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);

	/*