From owner-freebsd-bugs@FreeBSD.ORG Thu Nov 24 23:20:18 2005 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 [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 246F916A45B for ; Thu, 24 Nov 2005 23:20:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B952643D69 for ; Thu, 24 Nov 2005 23:20:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id jAONKA5i042963 for ; Thu, 24 Nov 2005 23:20:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id jAONKAIa042962; Thu, 24 Nov 2005 23:20:10 GMT (envelope-from gnats) Resent-Date: Thu, 24 Nov 2005 23:20:10 GMT Resent-Message-Id: <200511242320.jAONKAIa042962@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, Marcin Simonides Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6111916AF38 for ; Thu, 24 Nov 2005 23:17:16 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id F117445381 for ; Thu, 24 Nov 2005 21:01:42 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id jAOL1gNl089226 for ; Thu, 24 Nov 2005 21:01:42 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id jAOL1gE0089225; Thu, 24 Nov 2005 21:01:42 GMT (envelope-from nobody) Message-Id: <200511242101.jAOL1gE0089225@www.freebsd.org> Date: Thu, 24 Nov 2005 21:01:42 GMT From: Marcin Simonides To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: kern/89511: VIA 6420 SATA RAID0 array size is that of a single disk X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2005 23:20:18 -0000 >Number: 89511 >Category: kern >Synopsis: VIA 6420 SATA RAID0 array size is that of a single disk >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Nov 24 23:20:09 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Marcin Simonides >Release: 6.0-STABLE >Organization: >Environment: FreeBSD simon 6.0-STABLE FreeBSD 6.0-STABLE #2: Thu Nov 10 17:51:18 CET 2005 cinek@simon:/usr/obj/usr/src/sys/CUSTOM i386 >Description: Size of RAID 0 array is set to the size of one of disks that comprise the array instead of the sum of disks: atapci0: port 0xec00-0xec07,0xe800-0xe803,0xe400-0xe407,0xe000-0xe003,0xdc00-0xdc0f,0xd800-0xd8ff irq 20 at device 15.0 on pci0 [...] ad0: 29314MB at ata0-master UDMA100 ad4: 76319MB at ata2-master SATA150 ad6: 76319MB at ata3-master SATA150 ar0: 76319MB status: READY ar0: disk0 READY using ad4 at ata2-master ar0: disk1 READY using ad6 at ata3-master The size of ar0 should be 152638MB. Partitions starting beyond the first half of array are inaccessible. >How-To-Repeat: Just create a RAID 0 array in BIOS, the size reported by FreeBSD for respective ar device will be equal to the size of a single disk. >Fix: Go to src/sys/dev/ata/ata-raid.c and in function ata_raid_via_read_meta() change one line, here's a diff: --- ata-raid.c.orig Thu Nov 24 21:57:31 2005 +++ ata-raid.c Thu Nov 24 21:58:03 2005 @@ -3022,7 +3022,7 @@ case VIA_T_RAID0: raid->type = AR_T_RAID0; raid->width = meta->stripe_layout & VIA_L_MASK; - raid->total_sectors = meta->total_sectors; + raid->total_sectors = meta->total_sectors * raid->width; break; case VIA_T_RAID1: to multiply the number of total_sectors by the number of disks (I guess that's what raid->width stands for). Recompile and install the new kernel (but keep the old :). It has worked for me for a week now (data has been copied to and from a FAT slice near the end of array, both with FreeBSD and Windows), but I'm no expert, perhaps this "fix" may break something. >Release-Note: >Audit-Trail: >Unformatted: