diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-08-02 00:38:13 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-08-08 03:45:10 +0200 |
commit | 94ef80a5f0d72376a0dd2cfed0bd123123b405e2 (patch) | |
tree | 6a24e42e25a0afbd22dd70609f2e80511a489a3c /drivers/scsi/scsi_lib.c | |
parent | scsi: core: Make scsi_internal_device_unblock_nowait() reject invalid new_state (diff) | |
download | linux-94ef80a5f0d72376a0dd2cfed0bd123123b405e2.tar.xz linux-94ef80a5f0d72376a0dd2cfed0bd123123b405e2.zip |
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>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 7a4ac7a8e907..d47d637e6be2 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -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 |