Tejun Heo wrote:
Buffer length handling in simulated commands is error-prone and full of bugs. There are a number of places where necessary length checks are missing and if the output buffer is passed in as sglist, nothing works. This patch adds a static buffer ata_scsi_rbuf which is sufficiently large to handle the larges output from simulated commands (4k currently), let all simulte functions write to the buffer and removes all length checks as we know that there always is enough buffer space. Copying in (for ATAPI inquiry fix up) and out are handled by ata_scsi_copy_rbuf() behind ata_scsi_rbuf_get/put() interface and sglist is handled properly. This patch is inspired from buffer length check fix patch from Petr Vandrovec. Signed-off-by: Tejun Heo <htejun@xxxxxxxxx> Cc: Petr Vandrovec <petr@xxxxxxxxxx>
Looks much better than my lots of ifs. Thanks. Petr -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html