Skip to content

Commit 69cd720

Browse files
mikechristiemstsirkin
authored andcommitted
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 3f8ca2e ("vhost/scsi: Extract common handling code from control queue handler") when we added common helpers. Then in: commit 09d7583 ("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: 09d7583 ("vhost/scsi: Use common handling code in request queue handler") Signed-off-by: Mike Christie <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Reviewed-by: Stefano Garzarella <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 652abad commit 69cd720

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/vhost/scsi.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,10 +1226,8 @@ vhost_scsi_get_req(struct vhost_virtqueue *vq, struct vhost_scsi_ctx *vc,
12261226
/* validated at handler entry */
12271227
vs_tpg = vhost_vq_get_backend(vq);
12281228
tpg = READ_ONCE(vs_tpg[*vc->target]);
1229-
if (unlikely(!tpg)) {
1230-
vq_err(vq, "Target 0x%x does not exist\n", *vc->target);
1229+
if (unlikely(!tpg))
12311230
goto out;
1232-
}
12331231
}
12341232

12351233
if (tpgp)

0 commit comments

Comments
 (0)