Skip to content

Commit 70edd2e

Browse files
sreekanthbrcmmartinkpetersen
authored andcommitted
scsi: core: Avoid printing an error if target_alloc() returns -ENXIO
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/[email protected] Signed-off-by: Sreekanth Reddy <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent bc546c0 commit 70edd2e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/scsi/scsi_scan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,8 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
475475
error = shost->hostt->target_alloc(starget);
476476

477477
if(error) {
478-
dev_printk(KERN_ERR, dev, "target allocation failed, error %d\n", error);
478+
if (error != -ENXIO)
479+
dev_err(dev, "target allocation failed, error %d\n", error);
479480
/* don't want scsi_target_reap to do the final
480481
* put because it will be under the host lock */
481482
scsi_target_destroy(starget);

0 commit comments

Comments
 (0)