Thread (12 messages) 12 messages, 3 authors, 2005-08-27

Re: [PATCH] libata: error processing + rw 6 byte fix

From: Jens Axboe <hidden>
Date: 2005-08-23 07:17:06
Also in: linux-scsi

On Mon, Aug 22 2005, Douglas Gilbert wrote:
 	if (scsicmd[0] == READ_6 || scsicmd[0] == WRITE_6) {
-		qc->nsect = tf->nsect = scsicmd[4];
+		if (scsicmd[4] == 0) {
+			/*
+			 * For READ_6 and WRITE_6 (only)
+			 * transfer_len==0 -> 256 blocks !!
+			 */
+			if (lba48) {
+				tf->hob_nsect = 1;
+				qc->nsect = 256;
+			} else
+				return 1;
This isn't quite right, for 28-bit lba a 0 sector value means 256
sectors to transfer as well. So just make that:

        if (lba48) {
                tf->hob_nsect = 1;
                qc->nsect = 256;
        }

        /* continue */

and it should work fine. Similarly for 48-bit lba, 0 means 16^2 sectors.

-- 
Jens Axboe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help