From benjsc@clearchain.com  Thu Dec  7 02:24:08 2006
Return-Path: <benjsc@clearchain.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 3E8C616A417
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  7 Dec 2006 02:24:08 +0000 (UTC)
	(envelope-from benjsc@clearchain.com)
Received: from ipmail03.adl2.internode.on.net (ipmail03.adl2.internode.on.net [203.16.214.135])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4C54543CEF
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  7 Dec 2006 02:22:51 +0000 (GMT)
	(envelope-from benjsc@clearchain.com)
Received: from ppp199-237.lns1.adl4.internode.on.net (HELO mail.clearchain.com) ([203.122.199.237])
  by ipmail03.adl2.internode.on.net with ESMTP; 07 Dec 2006 12:53:37 +1030
Received: from pegasus.clearchain.com (localhost [127.0.0.1])
	by mail.clearchain.com (8.13.8/8.13.8) with ESMTP id kB72NYLC023332
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 7 Dec 2006 12:53:35 +1030 (CST)
	(envelope-from benjsc@pegasus.clearchain.com)
Received: (from benjsc@localhost)
	by pegasus.clearchain.com (8.13.8/8.13.8/Submit) id kB72NXdC023331;
	Thu, 7 Dec 2006 12:53:33 +1030 (CST)
	(envelope-from benjsc)
Message-Id: <200612070223.kB72NXdC023331@pegasus.clearchain.com>
Date: Thu, 7 Dec 2006 12:53:33 +1030 (CST)
From: Benjamin Close <Benjamin.Close@clearchain.com>
Reply-To: Benjamin Close <Benjamin.Close@clearchain.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Inform user of ata RAID5 acting as RAID0
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         106431
>Category:       bin
>Synopsis:       [patch] atacontrol(8): Inform user of ata RAID5 acting as RAID0
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 07 02:30:07 GMT 2006
>Closed-Date:    Tue Dec 11 05:50:33 UTC 2012
>Last-Modified:  Tue Dec 11 05:50:33 UTC 2012
>Originator:     Benjamin Close
>Release:        FreeBSD 6.1-->Current 7/12/2006
>Organization:
>Environment:
	Any machine with ata/sata controllers
>Description:
	At present the ata driver does not generate or use parity when dealing
	with RAID5 ata/sata arrays. Whist this is documented in ataraid(4) 
	unless the user reads the man page they would be unaware their RAID5
 	is actually a RAID0. 

	This critical difference should be highlighed to the user at boot time
	and when checking the raid status, so they can be made aware of the 
	problem.

	Losing a RAID set when you thought it was secure would be extremely bad.
	Also the driver has the potential to corrupt an already populated RAID5 as
	new data added will not have parity.
		
>How-To-Repeat:
	Boot any FreeBSD kernel on a machine with an ata/sata controller configured
	with a RAID5 array. 
>Fix:
	The below patch provides a boot time and status check time warning of the
	data safety risk that exists.

diff -ur src/sbin/atacontrol/atacontrol.c new-src/sbin/atacontrol/atacontrol.c
--- src/sbin/atacontrol/atacontrol.c    Thu Dec  7 11:06:41 2006
+++ new-src/sbin/atacontrol/atacontrol.c        Thu Dec  7 12:21:41 2006
@@ -581,6 +581,9 @@
                default:
                        printf("BROKEN\n");
                }
+               if ( config.type == AR_RAID5 )
+                   printf("WARNING: RAID5 parity not yet supported, continuing as RAID0 see ataraid(4)\n");
+
                exit(EX_OK);
        }
        usage();
diff -ur src/sys/dev/ata/ata-raid.c new-src/sys/dev/ata/ata-raid.c
--- src/sys/dev/ata/ata-raid.c  Wed Nov  1 07:49:25 2006
+++ new-src/sys/dev/ata/ata-raid.c      Thu Dec  7 12:22:28 2006
@@ -168,6 +168,9 @@
           ata_raid_format(rdp), ata_raid_type(rdp),
           buffer, ata_raid_flags(rdp));
 
+    if(rdp->type == AR_T_RAID5)
+       printf("ar%d: WARNING: RAID5 parity not yet supported, continuing as RAID0 see ataraid(4)\n",rdp->lun);
+
     if (testing || bootverbose)
        printf("ar%d: %ju sectors [%dC/%dH/%dS] <%s> subdisks defined as:\n",
               rdp->lun, rdp->total_sectors,
	
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Dec 7 03:46:45 UTC 2006 
Responsible-Changed-Why:  
Over to sos for evaluation. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106431 
Responsible-Changed-From-To: sos->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue May 12 04:40:37 UTC 2009 
Responsible-Changed-Why:  
sos@ is not actively working on ATA-related PRs. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106431 
State-Changed-From-To: open->closed 
State-Changed-By: eadler 
State-Changed-When: Tue Dec 11 05:50:32 UTC 2012 
State-Changed-Why:  
It seems this was fixed some time ago with different patch. Sorry this 
PR was ignored for so long :( 

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