From owner-freebsd-current@FreeBSD.ORG Thu Apr 16 03:01:30 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87307106568F for ; Thu, 16 Apr 2009 03:01:30 +0000 (UTC) (envelope-from james-freebsd-current@jrv.org) Received: from mail.jrv.org (adsl-70-243-84-13.dsl.austtx.swbell.net [70.243.84.13]) by mx1.freebsd.org (Postfix) with ESMTP id 37CAE8FC33 for ; Thu, 16 Apr 2009 03:01:29 +0000 (UTC) (envelope-from james-freebsd-current@jrv.org) Received: from kremvax.housenet.jrv (kremvax.housenet.jrv [192.168.3.124]) by mail.jrv.org (8.14.3/8.14.3) with ESMTP id n3G31GKa044450 for ; Wed, 15 Apr 2009 22:01:16 -0500 (CDT) (envelope-from james-freebsd-current@jrv.org) Authentication-Results: mail.jrv.org; domainkeys=pass (testing) header.from=james-freebsd-current@jrv.org DomainKey-Signature: a=rsa-sha1; s=enigma; d=jrv.org; c=nofws; q=dns; h=message-id:date:from:user-agent:mime-version:cc:subject: references:in-reply-to:content-type:content-transfer-encoding; b=v17W8r090OCrQYbeUVVzhVoNtEErw3/OrF/ZqIyDeQ6sklA/5s1TZc7lMcB3O1vmj /HEKiWF9kXCFA0dgrupVRggG6MDyx3TDL5XqnIbGndIbtnSoIhoClO3uyMGl4vGz3TV EZvlQ3qlFkfxQVmcKlKfgbOJaxtoidcI5e6xQwQ= Message-ID: <49E69F7C.9020402@jrv.org> Date: Wed, 15 Apr 2009 22:01:16 -0500 From: "James R. Van Artsdalen" User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 CC: freebsd-current@freebsd.org References: <49E4CED7.2040206@jrv.org> In-Reply-To: <49E4CED7.2040206@jrv.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: ata FLUSHCACHE timeout errors? [patch] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2009 03:01:30 -0000 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) @@ -134,6 +134,8 @@ 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; } @@ -295,9 +297,9 @@ (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) @@ -263,8 +263,9 @@ 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;