Re: [PATCH 0/6] scsi: make SG_IO user copyback failure-safe
From: Wang Yingjie
Date: Mon Oct 19 2026 - 02:32:31 EST
Hi Bart,
> How common are one-tag devices?
I don't have deployment figures, but usb-storage sets .can_queue = 1 in
usb_stor_host_template. The QEMU reproducer used an IDE CD-ROM through
ata_piix, whose host template also has .can_queue = 1.
> Has it been considered to disable SG_IO
> for one-tag devices instead of complicating the SG_IO implementation?
My concern with disabling SG_IO is that it would also reject working
passthrough commands on those devices. For example, smartctl uses SG_IO
on block devices for SCSI/SAT commands. The lifetime changes preserve that
interface by saving the request-backed completion data, freeing the
completed request, and then doing the potentially faulting user copies.
That does require extra storage for the completion results and sense data.
Separately, patches 4/6 and 6/6 fix lost data-copyback errors and do not
depend on the queue depth. I can split those out if that helps review.
Thanks,
Yingjie