kern/93368: ATA_SMART command is missing
Garry Belka
garry at NetworkPhysics.COM
Tue Feb 14 16:50:06 PST 2006
>Number: 93368
>Category: kern
>Synopsis: ATA_SMART command is missing
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Feb 15 00:50:05 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Garry Belka
>Release: FreeBSD 5.4-RELEASE i386
>Organization:
Network Physics
>Environment:
System: FreeBSD tempo.fractal.networkphysics.com 5.4-RELEASE FreeBSD i386
>Description:
ATA_SMART (0xb0) command is not defined. On error ATA driver prints
"Unknown CMD" instead of "SMART".
and, btw, there is a more serious bug lurking in ATA. In composite requests
with dependency, a first stage read will be marked as done,
even if it failed with error. Composite handling in ata_completed()
will immediately restart the channel I/O.
That will start a dependent write part of the composite,
likely to result in data corruption unless the whole disk failed.
>How-To-Repeat:
run smartd on a failing disk
>Fix:
apply a trivial patch below.
Index: sys/dev/ata/ata-queue.c
===================================================================
RCS file: /u1/Repo/FreeBSD/sys/dev/ata/ata-queue.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- sys/dev/ata/ata-queue.c 19 Jan 2006 19:09:32 -0000 1.10
+++ sys/dev/ata/ata-queue.c 15 Feb 2006 00:06:47 -0000 1.11
@@ -800,6 +800,7 @@
case 0xa0: return ("PACKET_CMD");
case 0xa1: return ("ATAPI_IDENTIFY");
case 0xa2: return ("SERVICE");
+ case 0xb0: return ("SMART");
case 0xc0: return ("CFA ERASE");
case 0xc4: return ("READ_MUL");
case 0xc5: return ("WRITE_MUL");
Index: sys/sys/ata.h
===================================================================
RCS file: /u1/Repo/FreeBSD/sys/sys/ata.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- sys/sys/ata.h 5 Nov 2005 00:25:25 -0000 1.5
+++ sys/sys/ata.h 15 Feb 2006 00:06:47 -0000 1.6
@@ -240,6 +240,7 @@
#define ATA_PACKET_CMD 0xa0 /* packet command */
#define ATA_ATAPI_IDENTIFY 0xa1 /* get ATAPI params*/
#define ATA_SERVICE 0xa2 /* service command */
+#define ATA_SMART_CMD 0xb0
#define ATA_CFA_ERASE 0xc0 /* CFA erase */
#define ATA_READ_MUL 0xc4 /* read multi */
#define ATA_WRITE_MUL 0xc5 /* write multi */
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list