Re: ata FLUSHCACHE timeout errors? [patch]

From: James R. Van Artsdalen <james-freebsd-current_at_jrv.org>
Date: Wed, 15 Apr 2009 22:01:16 -0500
James R. Van Artsdalen wrote:
> I am getting many FLUSHCACHE timeout errors during "zfs recv" operations.

This patch fixes this. PR to be filed.
In addition this causes any ata request that times out to print the
timeout, since it's going to be the timeout itself that's likely wrong.

A five-second timeout is used in the ATA code unless the disk is known
to be spun down.  This is almost certainly wrong as the ATA spec allows
devices to take up to 30 seconds.  Nonetheless I only changed the
FLUSHCACHE case that was failing.

Index: sys/dev/ata/ata-queue.c
===================================================================
--- sys/dev/ata/ata-queue.c     (revision 190917)
+++ sys/dev/ata/ata-queue.c     (working copy)
_at__at_ -134,6 +134,8 _at__at_
            device_printf(dev, "request while spun down, starting.\n");
            atadev->spindown_state = 0;
            request->timeout = 31;
+       } else if (command == ATA_FLUSHCACHE || command ==
ATA_FLUSHCACHE48) {
+           request->timeout = 31;
        } else {
            request->timeout = 5;
        }
_at__at_ -295,9 +297,9 _at__at_
            (request->retries-- > 0)) {
            if (!(request->flags & ATA_R_QUIET)) {
                device_printf(request->dev,
-                             "TIMEOUT - %s retrying (%d retr%s left)",
+                             "TIMEOUT - %s retrying (%d retr%s left)
timeout %d",
                              ata_cmd2str(request), request->retries,
-                             request->retries == 1 ? "y" : "ies");
+                             request->retries == 1 ? "y" : "ies",
request->timeout);
                if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL)))
                    printf(" LBA=%ju", request->u.ata.lba);
                printf("\n");
Index: sys/dev/ata/ata-disk.c
===================================================================
--- sys/dev/ata/ata-disk.c      (revision 190917)
+++ sys/dev/ata/ata-disk.c      (working copy)
_at__at_ -263,8 +263,9 _at__at_
        device_printf(dev, "request while spun down, starting.\n");
        atadev->spindown_state = 0;
        request->timeout = 31;
-    }
-    else {
+    } else if (bp->bio_cmd == BIO_FLUSH) {
+       request->timeout = 31;
+    } else {
        request->timeout = 5;
     }
     request->retries = 2;
Received on Thu Apr 16 2009 - 01:01:30 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:46 UTC