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@xxxxxx> Cc: Hannes Reinecke <hare@xxxxxxxx> Cc: Johannes Thumshirn <jthumshirn@xxxxxxx> Cc: Ming Lei <ming.lei@xxxxxxxxxx> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> --- drivers/scsi/scsi_lib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index bbed72eff9c9..c9630bd59b5a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2770,6 +2770,8 @@ int scsi_target_block(struct device *dev) else device_for_each_child(dev, &ret, target_block); + WARN_ONCE(ret, "ret = %d\n", ret); + return ret; } EXPORT_SYMBOL_GPL(scsi_target_block); -- 2.22.0.709.g102302147b-goog