From grog@blackwater.lemis.com  Sun Nov  9 21:37:28 2003
Return-Path: <grog@blackwater.lemis.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7291816A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  9 Nov 2003 21:37:28 -0800 (PST)
Received: from blackwater.lemis.com (sat-gw2.lemis.com [192.109.197.2])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7A71643FB1
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  9 Nov 2003 21:37:25 -0800 (PST)
	(envelope-from grog@blackwater.lemis.com)
Received: from blackwater.lemis.com (localhost [127.0.0.1])
	by blackwater.lemis.com (8.12.10/8.12.10) with ESMTP id hAA5bu63009503
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 10 Nov 2003 16:07:56 +1030 (CST)
	(envelope-from grog@blackwater.lemis.com)
Received: (from grog@localhost)
	by blackwater.lemis.com (8.12.10/8.12.10/Submit) id hAA5btWH009502;
	Mon, 10 Nov 2003 16:07:55 +1030 (CST)
	(envelope-from grog)
Message-Id: <200311100537.hAA5btWH009502@blackwater.lemis.com>
Date: Mon, 10 Nov 2003 16:07:55 +1030 (CST)
From: "Greg 'groggy' Lehey" <grog@blackwater.lemis.com>
Reply-To: "Greg 'groggy' Lehey" <grog@blackwater.lemis.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Serious data corruiption reading compact flash IDE drives
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         59103
>Category:       kern
>Synopsis:       Serious data corruption reading compact flash IDE drives
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 09 21:40:06 PST 2003
>Closed-Date:    Wed Jan 11 18:40:01 GMT 2006
>Last-Modified:  Wed Jan 11 18:40:01 GMT 2006
>Originator:     Greg 'groggy' Lehey
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
LEMIS (SA) Pty Ltd
>Environment:
System: FreeBSD wantadilla.lemis.com 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Sat Oct 26 11:16:38 CST 2002 grog@current.lemis.com:/usr/obj/src/FreeBSD/5-CURRENT-WANTADILLA/src/sys/WANTADILLA i386


        FreeBSD sydney.worldwide.lemis.com 5.1-CURRENT FreeBSD 5.1-CURRENT #2: Thu Oct  9 18:20:30 CST 2003     grog@sydney.worldwide.lemis.com:/home/obj/src/FreeBSD/5-CURRENT-KONDOPARINGA/src/sys/KONDOPARINGA  i386

>Description:

        It is no longer possible to read CF cards with FAT file
        systems (digital camera data) with -CURRENT.  This situation
        has persisted for well over a month.

	I have given this PR the category critical/high because of the
	data corruption and the fact that it occurs in what is to
	become a part of the base kernel.  Ideally, the change to this
	implementatino should not have occurred until such bugs were
	ironed out.

>How-To-Repeat:
        Mount a compact flash card on a -CURRENT machine:

        ad4: FAILURE - SETFEATURES status=51<READY,DSC,ERROR> error=4<ABORTED>
        ad4: FAILURE - SETFEATURES status=51<READY,DSC,ERROR> error=4<ABORTED>
        GEOM: create disk ad4 dp=0xc217d070
        ad4: 46MB <> [185/16/32] at ata2-master PIO2
        # mount -t msdos /dev/ad4s1 /camera
        Mounting root from ufs:/dev/ad0s3a
        # xv <any image file>

        The file will be corrupt.

        The same hardware, running under 4.6-RELEASE, does not report the
        failures above:

        ata4 at port 0x240-0x247,0x24e irq 11 slot 0 on pccard0
        ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO

        After copying the file to disk, the EOF is the same, but the
        contents are different (and correct in this case):

        $ cmp dscn2621.jpg dscn2621-corrupt.jpg 
        dscn2621.jpg dscn2621-corrupt.jpg differ: char 7681, line 30

        The data comes back in sync at offset 8192, suggesting that
        the data is not being transferred for the full length.

>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: netchild 
State-Changed-When: Sun Jan 8 15:42:17 UTC 2006 
State-Changed-Why:  
Is this still a problem with a recent -stable or -current? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=59103 
State-Changed-From-To: feedback->closed 
State-Changed-By: netchild 
State-Changed-When: Wed Jan 11 18:39:09 UTC 2006 
State-Changed-Why:  
From the originator: This problem no longer occurs. 

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