Unverified Commit 07d14ba2 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14000 scsi: smartpqi: add no_write_same for logical volumes

Merge Pull Request from: @fanhuimeng 
 
it is also the same issue for Euler. 
The RAID card's smartpqi driver does not support
the write same command for hardware. The system layer sends the
write same command, which can cause I/O errors in the block. 
 
Link:https://gitee.com/openeuler/kernel/pulls/14000

 

Reviewed-by: default avatarYuan Can <yuancan@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parents ad6bb783 50ccf1d2
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -176,6 +176,11 @@ static inline void pqi_scsi_done(struct scsi_cmnd *scmd)
	scmd->scsi_done(scmd);
}

static inline void pqi_disable_write_same(struct scsi_device *sdev)
{
	sdev->no_write_same = 1;
}

static inline bool pqi_scsi3addr_equal(u8 *scsi3addr1, u8 *scsi3addr2)
{
	return memcmp(scsi3addr1, scsi3addr2, 8) == 0;
@@ -5335,6 +5340,8 @@ static int pqi_slave_alloc(struct scsi_device *sdev)
			scsi_change_queue_depth(sdev,
				device->advertised_queue_depth);
		}
		if (pqi_is_logical_device(device))
			pqi_disable_write_same(sdev);
	}

	spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);