From owner-freebsd-stable@FreeBSD.ORG Sat Jul 1 02:01:58 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7AFDA16A47B for ; Sat, 1 Jul 2006 02:01:58 +0000 (UTC) (envelope-from nobody@mail.otel.net) Received: from mail.otel.net (gw3.OTEL.net [212.36.8.151]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBE2F43D7B for ; Sat, 1 Jul 2006 02:01:57 +0000 (GMT) (envelope-from nobody@mail.otel.net) Received: from nobody by mail.otel.net with local (Exim 4.62 (FreeBSD)) (envelope-from ) id 1FwUo1-000666-32 for freebsd-stable@freebsd.org; Sat, 01 Jul 2006 05:01:57 +0300 From: tbyte@OTEL.net To: "freebsd-stable@freebsd.org" Date: Sat, 01 Jul 2006 02:01:57 GMT Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_0_23441_1151719317"; charset="iso-8859-1" Message-Id: Sender: Unprivileged user Subject: Bug in ata (ata-all.c) driver X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2006 02:01:58 -0000 This is a MIME-formatted message. If you see this text it means that your mail software cannot handle MIME-formatted messages. --=_0_23441_1151719317 Content-Type: text/plain; format=flowed; charset=iso-8859-1 Content-Transfer-Encoding: 7bit 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. The "giant" patch is attached. It's agains today's -STABLE. regards --=_0_23441_1151719317 Content-Disposition: attachment; filename="ata-all.c.diff" Content-Type: text/plain; charset="iso-8859-1"; name="ata-all.c.diff" Content-Transfer-Encoding: 7bit --- 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; --=_0_23441_1151719317--