From nobody@FreeBSD.org  Mon Jul 19 05:14:01 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C6772106567E
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 19 Jul 2010 05:14:01 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id B59038FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 19 Jul 2010 05:14:01 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o6J5E1Au008016
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 19 Jul 2010 05:14:01 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o6J5E1JK008015;
	Mon, 19 Jul 2010 05:14:01 GMT
	(envelope-from nobody)
Message-Id: <201007190514.o6J5E1JK008015@www.freebsd.org>
Date: Mon, 19 Jul 2010 05:14:01 GMT
From: Tatsuya Hagino <hagino@sfc.keio.ac.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ATA Raid Metadata Read Write Inconsistency
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         148748
>Category:       kern
>Synopsis:       [ataraid] Metadata Read Write Inconsistency
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 19 05:20:08 UTC 2010
>Closed-Date:    
>Last-Modified:  Tue Jan 15 02:40:01 UTC 2013
>Originator:     Tatsuya Hagino
>Release:        8.1-PRERELEASE
>Organization:
Keio University
>Environment:
FreeBSD hagino2 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #0: Sun Jul 18 23:53:05 JST 2010     root@:/usr/src/sys/amd64/compile/GENERIC  amd64
>Description:
I have reported this problem before, but it has not yet fixed.  This is just a simple mistake in the source code.

When using ATI (now AMD) SB700 SATA Controler and using atacontrol to create RAID1 mirroring, the metadata written on the disk by atacontrol command is VIA metadata format (since ATA metadata format in unknown), but when the metadata is read, it is read as SILICON_IMAGE metadata and it fails because it is VIA metadata format.
>How-To-Repeat:
1. Use ATI SB700 SATA Controler AHCI mode
2. use atacontrol command to create RAID1
3. it fails to read the metadata created by 2

>Fix:
Change /usr/src/sys/dev/ata/ata-raid.c to use the same metadata format bor both read an write.  For example, I have changed ata_raid_read_metadata so that ATA_ATI_ID is not with ATA_SILICON_IMAGE_ID but with ATA_VIA_ID.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-standards->freebsd-bugs 
Responsible-Changed-By: jilles 
Responsible-Changed-When: Tue Jul 20 12:24:14 UTC 2010 
Responsible-Changed-Why:  
Fix category/assignment. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148748 

From: Alexander Motin <mav@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/148748: [ataraid] Metadata Read Write Inconsistency
Date: Tue, 15 Jan 2013 04:39:36 +0200

 Legacy ataraid(4) code has many problems. Instead of fixing them, users
 are encouraged to migrate to the new RAID implementation graid(8).
 AMD/Promise metadata format is well supported by it.
 
 -- 
 Alexander Motin
>Unformatted:
