nfsd: make nfsd4_scsi_identify_device retry with a larger buffer
authorScott Mayhew <smayhew@redhat.com>
Fri, 11 May 2018 15:19:00 +0000 (11:19 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 11 May 2018 16:20:29 +0000 (12:20 -0400)
commitdac2707227bf35c19f7771e5f19b61bc334b6cd1
tree45ce51cc059b74d7000988391a7f6384550a33d4
parent9c2ece6ef67e9d376f32823086169b489c422ed0
nfsd: make nfsd4_scsi_identify_device retry with a larger buffer

nfsd4_scsi_identify_device() performs a single IDENTIFY command for the
device identification VPD page using a small buffer.  If the reply is
too large to fit in this buffer then the GETDEVICEINFO reply will not
contain any info for the SCSI volume aside from the registration key.
This can happen for example if the device has descriptors using long
SCSI name strings.

When the initial reply from the device indicates a larger buffer is
needed, retry once using the page length from that reply.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/blocklayout.c