USB storage devices and SAT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



USB storage devices that support SAT (the T10 SCSI to ATA
translation standard) are beginning to appear.

SAT enables tools like smartmontools to access SMART data
on a ATA disk in a USB enclosure. We have run into
a problem. It seems that the usb storage subsystem is wedded
to the idea of sense data that is no longer than 18 bytes. **
That doesn't play well with SAT which uses descriptor format
sense data that is made up of an 8 byte header plus zero or
more descriptors. SAT uses a 14 byte "ATA return" (sense)
descriptor to yield the ATA registers. That means the sense
data length is 22 bytes when an ATA return descriptor is
required.

Alan Stern has already noted to another smartmontools developer
that such a change is likely to break some USB storage devices.
Perhaps the maximum sense buffer size could be optionally
specified per usb storage device. Alternatively the usb mass
storage logic could make some dynamic decisions itself.
For example if the (disk) device responds successfully to either
SCSI ATA PASS_THROUGH (12 or 16 byte) command then it will
be capable of (at least) 22 byte sense data. A T10 vendor
identification field in a standard INQUIRY response of
"ATA     " is another indication of a device that supports
SAT.


** the 18 byte sense data limit comes from SCSI-2 (circa 1992).
That was upped to 252 bytes around 10 years ago. Some SCSI disk
vendors have been using the extra bytes (above 18) for some
time. Then in SPC-3 (standard in 2005) descriptor format sense
data was introduced and SAT uses it. There are other uses: any
SCSI (virtual) disk that needs more than 32 bits to represent all
its LBAs should use descriptor format for MEDIUM ERRORs. The
reason is that MEDIUM ERRORs should include the LBA of the first
failure and the "info" field in the older "fixed" sense format
is only 4 bytes.

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux