提交 1310dde0 编写于 作者: S Sreekanth Reddy 提交者: Zheng Zengkai

scsi: core: Avoid printing an error if target_alloc() returns -ENXIO

stable inclusion
from stable-5.10.61
commit 8071dbe1bdd0ffe78ef8399ae683b1ed3ff36fcc
bugzilla: 177029 https://gitee.com/openeuler/kernel/issues/I4EAXD

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

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

[ Upstream commit 70edd2e6 ]

Avoid printing a 'target allocation failed' error if the driver
target_alloc() callback function returns -ENXIO. This return value
indicates that the corresponding H:C:T:L entry is empty.

Removing this error reduces the scan time if the user issues SCAN_WILD_CARD
scan operation through sysfs parameter on a host with a lot of empty
H:C:T:L entries.

Avoiding the printk on -ENXIO matches the behavior of the other callback
functions during scanning.

Link: https://lore.kernel.org/r/20210726115402.1936-1-sreekanth.reddy@broadcom.comSigned-off-by: NSreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 19754456
...@@ -453,7 +453,8 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, ...@@ -453,7 +453,8 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
error = shost->hostt->target_alloc(starget); error = shost->hostt->target_alloc(starget);
if(error) { if(error) {
dev_printk(KERN_ERR, dev, "target allocation failed, error %d\n", error); if (error != -ENXIO)
dev_err(dev, "target allocation failed, error %d\n", error);
/* don't want scsi_target_reap to do the final /* don't want scsi_target_reap to do the final
* put because it will be under the host lock */ * put because it will be under the host lock */
scsi_target_destroy(starget); scsi_target_destroy(starget);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册