scsi_debug: fix sleep in invalid context
authorDouglas Gilbert <dgilbert@interlog.com>
Tue, 31 May 2016 21:15:07 +0000 (17:15 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 13 Jul 2016 03:16:31 +0000 (23:16 -0400)
commitfb0cc8d1c1881c56683123ff129452e88fdf5575
tree7df3e14ae2d4446d67b2a129f99081bd96dcc2d4
parentbaa6719f902af9c03e528b08dfb847de295b5137
scsi_debug: fix sleep in invalid context

In this post: http://www.spinics.net/lists/linux-scsi/msg97124.html the
author shows some kernel infrastructure complaining about a sleep in an
invalid context. Remove offending call to vmalloc().  Instead of using
kzalloc() which reviewers didn't like, use a bucket system (64 bytes on
the stack) and potentially multiple calls to sg_pcopy_from_buffer() to
construct the 'data-in' buffer for the SCSI REPORT LUNS command.

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_debug.c