Unverified Commit 1c944d2d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!2088 [openEuler-1.0-LTS] bugfixes of scsi

Merge Pull Request from: @LiuYongQiang0816 
 
3 patches from zhongjinghua 
 
Link:https://gitee.com/openeuler/kernel/pulls/2088

 

Reviewed-by: default avatarYu Kuai <yukuai3@huawei.com>
Reviewed-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parents 4396b569 500abdd4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -477,6 +477,9 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)

	shost->use_blk_mq = scsi_use_blk_mq || shost->hostt->force_blk_mq;

	if (!sht->module)
		shost->is_builtin = true;

	device_initialize(&shost->shost_gendev);
	dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
	shost->shost_gendev.bus = &scsi_bus_type;
+5 −1
Original line number Diff line number Diff line
@@ -557,11 +557,15 @@ EXPORT_SYMBOL(scsi_report_opcode);
 */
int scsi_device_get(struct scsi_device *sdev)
{
	struct module *module;

	if (sdev->sdev_state == SDEV_DEL || sdev->sdev_state == SDEV_CANCEL)
		goto fail;
	if (!get_device(&sdev->sdev_gendev))
		goto fail;
	if (!try_module_get(sdev->host->hostt->module))

	module = sdev->host->hostt->module;
	if ((!module && !sdev->host->is_builtin) || !try_module_get(module))
		goto fail_put_device;
	return 0;

+8 −0
Original line number Diff line number Diff line
@@ -710,7 +710,15 @@ struct Scsi_Host {
	 */
	struct device *dma_dev;


#ifndef __GENKSYMS__
	union {
		bool is_builtin;
		KABI_RESERVE(1)
	};
#else
	KABI_RESERVE(1)
#endif
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)