scsi_scan: Restrict sequential scan to 256 LUNs
authorHannes Reinecke <hare@suse.de>
Tue, 3 Jun 2014 08:58:53 +0000 (10:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Sep 2014 16:19:13 +0000 (09:19 -0700)
commit2fc0acc5c14a0fd2973d8af261017df4f6d2fa3f
treed84a29752a0877f5faad481eec9195e3e77bf71e
parentf3b5d5800b1d4a6dc558877eef41c152ee91b1f3
scsi_scan: Restrict sequential scan to 256 LUNs

commit 22ffeb48b7584d6cd50f2a595ed6065d86a87459 upstream.

Sequential scan for more than 256 LUNs is very fragile as
LUNs might not be numbered sequentially after that point.

SAM revisions later than SCSI-3 impose a structure on
LUNs larger than 256, making LUN numbers between 256
and 16384 illegal.
SCSI-3, however allows for plain 64-bit numbers with
no internal structure.

So restrict sequential LUN scan to 256 LUNs and add a
new blacklist flag 'BLIST_SCSI3LUN' to scan up to
max_lun devices.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Ewan Milne <emilne@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/scsi_scan.c
include/scsi/scsi_devinfo.h