vhost-scsi: Fix log flooding with target does not exist errors
authorMike Christie <michael.christie@oracle.com>
Wed, 11 Jun 2025 21:01:13 +0000 (16:01 -0500)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 1 Aug 2025 13:11:08 +0000 (09:11 -0400)
commit69cd720a8a5e9ef0f05ce5dd8c9ea6e018245c82
treebb15346808dee51e041b47b377e8aa74dd7ba59d
parent652abad08571a067b16c5bb47ad5ea7478517e7d
vhost-scsi: Fix log flooding with target does not exist errors

As part of the normal initiator side scanning the guest's scsi layer
will loop over all possible targets and send an inquiry. Since the
max number of targets for virtio-scsi is 256, this can result in 255
error messages about targets not existing if you only have a single
target. When there's more than 1 vhost-scsi device each with a single
target, then you get N * 255 log messages.

It looks like the log message was added by accident in:

commit 3f8ca2e115e5 ("vhost/scsi: Extract common handling code from
control queue handler")

when we added common helpers. Then in:

commit 09d7583294aa ("vhost/scsi: Use common handling code in request
queue handler")

we converted the scsi command processing path to use the new
helpers so we started to see the extra log messages during scanning.

The patches were just making some code common but added the vq_err
call and I'm guessing the patch author forgot to enable the vq_err
call (vq_err is implemented by pr_debug which defaults to off). So
this patch removes the call since it's expected to hit this path
during device discovery.

Fixes: 09d7583294aa ("vhost/scsi: Use common handling code in request queue handler")
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20250611210113.10912-1-michael.christie@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/scsi.c