Commit 230035ef authored by Li Nan's avatar Li Nan Committed by Zheng Zengkai
Browse files

scsi: iscsi: fix kabi broken in struct iscsi_transport

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5HL0X


CVE: NA

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

In struct iscsi_transport, "unbind_conn" was added and the kabi
is broken. Fix it by using "tgt_dscvr" and caps flag.

Signed-off-by: default avatarLi Nan <linan122@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarlinan <linan122@huawei.com>
Reviewed-by: default avatarJason Yan <yanaijie@huawei.com>
parent 9fa5f876
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -979,17 +979,22 @@ static struct scsi_host_template iscsi_iser_sht = {
	.track_queue_depth	= 1,
};

static struct iscsi_transport_expand iscsi_iser_expand = {
	.unbind_conn            = iscsi_conn_unbind,
};

static struct iscsi_transport iscsi_iser_transport = {
	.owner                  = THIS_MODULE,
	.name                   = "iser",
	.caps                   = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_TEXT_NEGO,
	.caps                   = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_TEXT_NEGO
					| CAP_OPS_EXPAND,
	/* session management */
	.create_session         = iscsi_iser_session_create,
	.destroy_session        = iscsi_iser_session_destroy,
	/* connection management */
	.create_conn            = iscsi_iser_conn_create,
	.bind_conn              = iscsi_iser_conn_bind,
	.unbind_conn		= iscsi_conn_unbind,
	.ops_expand             = &iscsi_iser_expand,
	.destroy_conn           = iscsi_conn_teardown,
	.attr_is_visible	= iser_attr_is_visible,
	.set_param              = iscsi_iser_set_param,
+7 −2
Original line number Diff line number Diff line
@@ -5801,16 +5801,21 @@ static struct pci_error_handlers beiscsi_eeh_handlers = {
	.resume = beiscsi_eeh_resume,
};

struct iscsi_transport_expand beiscsi_iscsi_expand = {
	.unbind_conn = iscsi_conn_unbind,
};

struct iscsi_transport beiscsi_iscsi_transport = {
	.owner = THIS_MODULE,
	.name = DRV_NAME,
	.caps = CAP_RECOVERY_L0 | CAP_HDRDGST | CAP_TEXT_NEGO |
		CAP_MULTI_R2T | CAP_DATADGST | CAP_DATA_PATH_OFFLOAD,
		CAP_MULTI_R2T | CAP_DATADGST | CAP_DATA_PATH_OFFLOAD |
		CAP_OPS_EXPAND,
	.create_session = beiscsi_session_create,
	.destroy_session = beiscsi_session_destroy,
	.create_conn = beiscsi_conn_create,
	.bind_conn = beiscsi_conn_bind,
	.unbind_conn = iscsi_conn_unbind,
	.ops_expand = &beiscsi_iscsi_expand,
	.destroy_conn = iscsi_conn_teardown,
	.attr_is_visible = beiscsi_attr_is_visible,
	.set_iface_param = beiscsi_iface_set_param,
+7 −2
Original line number Diff line number Diff line
@@ -2274,18 +2274,23 @@ static struct scsi_host_template bnx2i_host_template = {
	.track_queue_depth	= 1,
};


static struct iscsi_transport_expand bnx2i_iscsi_expand = {
	.unbind_conn            = iscsi_conn_unbind,
};

struct iscsi_transport bnx2i_iscsi_transport = {
	.owner			= THIS_MODULE,
	.name			= "bnx2i",
	.caps			= CAP_RECOVERY_L0 | CAP_HDRDGST |
				  CAP_MULTI_R2T | CAP_DATADGST |
				  CAP_DATA_PATH_OFFLOAD |
				  CAP_TEXT_NEGO,
				  CAP_TEXT_NEGO | CAP_OPS_EXPAND,
	.create_session		= bnx2i_session_create,
	.destroy_session	= bnx2i_session_destroy,
	.create_conn		= bnx2i_conn_create,
	.bind_conn		= bnx2i_conn_bind,
	.unbind_conn		= iscsi_conn_unbind,
	.ops_expand             = &bnx2i_iscsi_expand,
	.destroy_conn		= bnx2i_conn_destroy,
	.attr_is_visible	= bnx2i_attr_is_visible,
	.set_param		= iscsi_set_param,
+7 −2
Original line number Diff line number Diff line
@@ -100,13 +100,18 @@ static struct scsi_host_template cxgb3i_host_template = {
	.track_queue_depth = 1,
};

static struct iscsi_transport_expand cxgb3i_iscsi_expand = {
	.unbind_conn            = iscsi_conn_unbind,
};

static struct iscsi_transport cxgb3i_iscsi_transport = {
	.owner		= THIS_MODULE,
	.name		= DRV_MODULE_NAME,
	/* owner and name should be set already */
	.caps		= CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST
				| CAP_DATADGST | CAP_DIGEST_OFFLOAD |
				CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO,
				CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO |
				CAP_OPS_EXPAND,
	.attr_is_visible	= cxgbi_attr_is_visible,
	.get_host_param	= cxgbi_get_host_param,
	.set_host_param	= cxgbi_set_host_param,
@@ -117,7 +122,7 @@ static struct iscsi_transport cxgb3i_iscsi_transport = {
	/* connection management */
	.create_conn	= cxgbi_create_conn,
	.bind_conn	= cxgbi_bind_conn,
	.unbind_conn	= iscsi_conn_unbind,
	.ops_expand     = &cxgb3i_iscsi_expand,
	.destroy_conn	= iscsi_tcp_conn_teardown,
	.start_conn	= iscsi_conn_start,
	.stop_conn	= iscsi_conn_stop,
+7 −2
Original line number Diff line number Diff line
@@ -118,12 +118,17 @@ static struct scsi_host_template cxgb4i_host_template = {
	.track_queue_depth = 1,
};

static struct iscsi_transport_expand cxgb4i_iscsi_expand = {
	.unbind_conn            = iscsi_conn_unbind,
};

static struct iscsi_transport cxgb4i_iscsi_transport = {
	.owner		= THIS_MODULE,
	.name		= DRV_MODULE_NAME,
	.caps		= CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST |
				CAP_DATADGST | CAP_DIGEST_OFFLOAD |
				CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO,
				CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO |
				CAP_OPS_EXPAND,
	.attr_is_visible	= cxgbi_attr_is_visible,
	.get_host_param	= cxgbi_get_host_param,
	.set_host_param	= cxgbi_set_host_param,
@@ -134,7 +139,7 @@ static struct iscsi_transport cxgb4i_iscsi_transport = {
	/* connection management */
	.create_conn	= cxgbi_create_conn,
	.bind_conn		= cxgbi_bind_conn,
	.unbind_conn	= iscsi_conn_unbind,
	.ops_expand     = &cxgb4i_iscsi_expand,
	.destroy_conn	= iscsi_tcp_conn_teardown,
	.start_conn		= iscsi_conn_start,
	.stop_conn		= iscsi_conn_stop,
Loading