scsi: core: Complain if scsi_target_block() fails

If scsi_target_block() fails that can break the code that calls this
function. Hence complain loudly if scsi_target_block() fails.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Bart Van Assche 2019-08-01 15:38:13 -07:00 committed by Martin K. Petersen
parent 09addb1d16
commit 94ef80a5f0

View File

@ -2772,7 +2772,12 @@ static int scsi_internal_device_unblock(struct scsi_device *sdev,
static void
device_block(struct scsi_device *sdev, void *data)
{
scsi_internal_device_block(sdev);
int ret;
ret = scsi_internal_device_block(sdev);
WARN_ONCE(ret, "scsi_internal_device_block(%s) failed: ret = %d\n",
dev_name(&sdev->sdev_gendev), ret);
}
static int