From owner-freebsd-bugs@FreeBSD.ORG Sun Jul 2 23:00:35 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 [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F39B16A415 for ; Sun, 2 Jul 2006 23:00:35 +0000 (UTC) (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 B1EB443D48 for ; Sun, 2 Jul 2006 23:00:34 +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 k62N0YiA021739 for ; Sun, 2 Jul 2006 23:00:34 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k62N0Ymo021738; Sun, 2 Jul 2006 23:00:34 GMT (envelope-from gnats) Resent-Date: Sun, 2 Jul 2006 23:00:34 GMT Resent-Message-Id: <200607022300.k62N0Ymo021738@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, "Iasen Kostoff" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB9C916A52D; Sun, 2 Jul 2006 22:54:17 +0000 (UTC) (envelope-from tbyte@otel.net) Received: from mail.otel.net (gw3.OTEL.net [212.36.8.151]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C0DA43E87; Sun, 2 Jul 2006 22:22:15 +0000 (GMT) (envelope-from tbyte@otel.net) Received: from warhead.otel.net ([212.36.8.210]) by mail.otel.net with esmtp (Exim 4.62 (FreeBSD)) (envelope-from ) id 1FxAKT-0006AS-1N; Mon, 03 Jul 2006 01:22:13 +0300 Message-Id: <1151878932.16831@WarHeaD.OTEL.net> Date: Mon, 3 Jul 2006 01:22:12 +0300 From: "Iasen Kostoff" To: "FreeBSD gnats submit" X-Send-Pr-Version: gtk-send-pr 0.4.7 Cc: freebsd-stable@FreeBSD.org Subject: kern/99729: Bug in ata (ata-all.c) driver 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: Sun, 02 Jul 2006 23:00:35 -0000 >Number: 99729 >Category: kern >Synopsis: Bug in ata (ata-all.c) driver >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jul 02 23:00:33 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Iasen Kostoff >Release: FreeBSD 6.1-STABLE i386 >Organization: OTEL.net >Environment: System: FreeBSD 6.1-STABLE #2: Sat Jul 1 13:01:14 EEST 2006 root@WarHeaD.OTEL.net:/usr/src6/sys/i386/compile/WARHEAD >Description: I found a little bug (probably) in sys/dev/ata-all.c which somehow corrupts device parameters structure. When I first did "atacontrol list" device info about ad0 looked like this: Master: ad0 ATA/ATAPI revision 7 after I ran "atacontrol cap ad0" it printed somewhat messy output like having enabled SMART but not supported... then I did "atacontrol list" again and saw that the line about ad0 have changed to something like this: Master: ad0 ATA/ATAPI revision 0 or similar. After some digging and comparing the way "IOCATADEVICES" and "IOCATAGPARM" work I saw (probably) bogus ata_getparam() call. After removing this call to ata_getparam() everything work as expected (atleast that's what it looks like for ~30 min run). "atacontrol cap ad0" shows right results and doesn't screw the device parameters. I just hope that this doesn't break something else but I doubt it coz it just gets info and doesn't set anything. >How-To-Repeat: In description. >Fix: --- ata-all.c.old Sat Jul 1 04:10:30 2006 +++ ata-all.c Sat Jul 1 04:40:26 2006 @@ -505,7 +505,6 @@ return error; case IOCATAGPARM: - ata_getparam(atadev, 0); bcopy(&atadev->param, params, sizeof(struct ata_params)); return 0; >Release-Note: >Audit-Trail: >Unformatted: