Luben Tuikov wrote: > SG_DXFER_TO_FROM_DEV means DMA_BIDIRECTIONAL, not > DMA_FROM_DEVICE. > > Signed-off-by: Luben Tuikov <ltuikov@xxxxxxxxx> > --- > drivers/scsi/sg.c | 11 +++++------ > 1 files changed, 5 insertions(+), 6 deletions(-) > > This patch is 8 months old. While this patch is sensible, it breaks a very arcane usage that I inherited with the sg driver in 1998. At that time there was no resid, so application clients (e.g. cdrecord) had no way of knowing if the amount of data they requested to be read, was actually read. So, as indirect IO was the only game in town, the hack used was to prefill the kernel buffer prior to a read, and then check if it had been overwritten after the read operation. Hence SG_DXFER_TO_FROM_DEV was actually a read from the device. Some LLDs still do not implement resid (properly). I'm happy to accept the change as long as people are prepared to wear the breakage. Doug Gilbert - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html