From root@r2d2.multiplay.co.uk  Tue Jun 21 12:49:42 2005
Return-Path: <root@r2d2.multiplay.co.uk>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 099A816A41C;
	Tue, 21 Jun 2005 12:49:42 +0000 (GMT)
	(envelope-from root@r2d2.multiplay.co.uk)
Received: from r2d2.multiplay.co.uk (host7.iclon.multiplay.co.uk [212.135.219.182])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 93A5F43D1D;
	Tue, 21 Jun 2005 12:49:41 +0000 (GMT)
	(envelope-from root@r2d2.multiplay.co.uk)
Received: from r2d2.multiplay.co.uk (localhost [127.0.0.1])
	by r2d2.multiplay.co.uk (8.13.3/8.13.3) with ESMTP id j5LDomZ5000650;
	Tue, 21 Jun 2005 13:50:48 GMT
	(envelope-from root@r2d2.multiplay.co.uk)
Received: (from root@localhost)
	by r2d2.multiplay.co.uk (8.13.3/8.13.3/Submit) id j5LDomF4000649;
	Tue, 21 Jun 2005 13:50:48 GMT
	(envelope-from root)
Message-Id: <200506211350.j5LDomF4000649@r2d2.multiplay.co.uk>
Date: Tue, 21 Jun 2005 13:50:48 GMT
From: Steven Hartland <killing@multiplay.co.uk>
Reply-To: Steven Hartland <killing@multiplay.co.uk>
To: FreeBSD-gnats-submit@freebsd.org
Cc: freebsd-stable-list <freebsd-stable@freebsd.org>
Subject: hptmv ( Highpoint RocketRaid 1820a ) corrupts fs on shutdown -p
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         82482
>Category:       kern
>Synopsis:       [hptmv] [patch] hptmv(4) ( Highpoint RocketRaid 1820a ) corrupts fs on shutdown -p
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 21 12:50:18 GMT 2005
>Closed-Date:    Sun Jan 08 16:34:52 GMT 2006
>Last-Modified:  Sun Jan 08 16:34:52 GMT 2006
>Originator:     Steven Hartland <killing@multiplay.co.uk>
>Release:        FreeBSD 5.4-RELEASE-p2 i386
>Organization:
Multiplay
>Environment:
System: FreeBSD r2d2.multiplay.co.uk 5.4-RELEASE-p2 FreeBSD 5.4-RELEASE-p2 #5: Tue Jun 21 13:29:02 UTC 2005 root@r2d2.multiplay.co.uk:/.usr/i386/src/sys/i386/compile/MPUK_SMP_200HZ i386


>Description:
	When shutting down with power off e.g. shutdown -p now a machine with a
	Highpoint RocketRaid 1820a ( more than likely the 1820 as well ) corrupts
	the FS bad enough to force recorvery in single user mode.
	The problem occurs because the disk flush is async and no time is given
	for this to happen.

>How-To-Repeat:
	Shutdown a box with a hptmv based controller with power off.

>Fix:

	Apply the following patch which adds a 5 second delay after calling flush.
	Note: the fix is only relavent for i386 as there is no source for amd64,
	which is also affected. I've informed Highpoint of the issue but as yet
	no updated driver has been released.

--- entry.c.orig	Tue Jun 21 13:23:05 2005
+++ entry.c	Tue Jun 21 13:27:38 2005
@@ -2157,6 +2157,10 @@
 		return (EINVAL);
 
-	EVENTHANDLER_DEREGISTER(shutdown_final, pAdapter->eh);
 	FlushAdapter(pAdapter);
+
+	/* give the flush some time to happen */
+	DELAY( 1000 * 1000 * 5 );
+
+	EVENTHANDLER_DEREGISTER(shutdown_final, pAdapter->eh);
 
 	return 0;


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: netchild 
State-Changed-When: Sun Jan 8 16:33:34 UTC 2006 
State-Changed-Why:  
Something like this is in 6-stable and -current. Maybe it entered 
the tree with an update by Highpoint. Thanks notifying the vendor. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=82482 
>Unformatted:
