On Thu, Jan 10, 2019 at 12:11:53PM -0800, Tyrel Datwyler wrote: > This allocation isn't a single use allocation. The driver is just lazy about > allocating our ext_list area for large SG lists (ie. SG_ALL). When the driver > was first written it only supported up to 10 indirect SRP buffers. James > Bottemley added the large SG support back in 2005 with the commit referenced > here in the fixes tag "4dddbc26c389". We only allocate the ext_list when we > come across a SG list requiring more than 10 indirect buffers. Once allocated > we will reuse if already allocated.
I think the right fix is to just allocate the buffer for the ext_list as part of the scsi command using the .cmd_size field in the host template, and then dma map it in queuecommand and unmap it on completion.