From owner-freebsd-bugs@FreeBSD.ORG Thu Dec 7 02:30:10 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09B1816A4D2 for ; Thu, 7 Dec 2006 02:30:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 992A943CA8 for ; Thu, 7 Dec 2006 02:29:19 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id kB72U7lG078822 for ; Thu, 7 Dec 2006 02:30:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id kB72U73T078820; Thu, 7 Dec 2006 02:30:07 GMT (envelope-from gnats) Resent-Date: Thu, 7 Dec 2006 02:30:07 GMT Resent-Message-Id: <200612070230.kB72U73T078820@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Benjamin Close Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E8C616A417 for ; 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 ; 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 ; 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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/106431: Inform user of ata RAID5 acting as RAID0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Benjamin Close List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Dec 2006 02:30:10 -0000 >Number: 106431 >Category: kern >Synopsis: Inform user of ata RAID5 acting as RAID0 >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Thu Dec 07 02:30:07 GMT 2006 >Closed-Date: >Last-Modified: >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: >Unformatted: