From owner-freebsd-current@FreeBSD.ORG Fri Dec 11 14:10:43 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 390941065670 for ; Fri, 11 Dec 2009 14:10:43 +0000 (UTC) (envelope-from gjb@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id DDB0B8FC16 for ; Fri, 11 Dec 2009 14:10:41 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 9EF51C3BA8 for ; Fri, 11 Dec 2009 15:10:33 +0100 (CET) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id dYRlCVfhv8xW for ; Fri, 11 Dec 2009 15:10:32 +0100 (CET) Received: from [192.168.1.12] (aczm176.neoplus.adsl.tpnet.pl [83.11.222.176]) by smtp.semihalf.com (Postfix) with ESMTPA id C208FC3BA7 for ; Fri, 11 Dec 2009 15:10:32 +0100 (CET) Message-ID: <4B2252BE.8080806@semihalf.com> Date: Fri, 11 Dec 2009 15:10:06 +0100 From: Grzegorz Bernacki User-Agent: Thunderbird 2.0.0.16 (X11/20090618) MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 11 Dec 2009 14:51:42 +0000 Subject: Possible bug in ata-disk.c X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 14:10:43 -0000 Hi, I've looked over ATA code and I've noticed that setting DISKFLAG_CANDELETE big in disk->d_flags clears DISKFLAGS_CANFLUSHCAHCE bit if it was set. Below is the patch. --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -133,11 +133,11 @@ ad_attach(device_t dev) adp->disk->d_unit = device_get_unit(dev); if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE) adp->disk->d_flags = DISKFLAG_CANFLUSHCACHE; if ((atadev->param.support.command2 & ATA_SUPPORT_CFA) || atadev->param.config == ATA_PROTO_CFA) - adp->disk->d_flags |= DISKFLAG_CANDELETE; + adp->disk->d_flags = DISKFLAG_CANDELETE; snprintf(adp->disk->d_ident, sizeof(adp->disk->d_ident), "ad:%s", atadev->param.serial); disk_create(adp->disk, DISK_VERSION); device_add_child(dev, "subdisk", device_get_unit(dev)); ad_firmware_geom_adjust(dev, adp->disk); regards, Grzesiek