From owner-freebsd-current@FreeBSD.ORG Fri Dec 11 15:02:35 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 319921065672; Fri, 11 Dec 2009 15:02:35 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 417618FC0C; Fri, 11 Dec 2009 15:02:33 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA09760; Fri, 11 Dec 2009 17:02:30 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <4B225F05.20004@icyb.net.ua> Date: Fri, 11 Dec 2009 17:02:29 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Grzegorz Bernacki References: <4B2252BE.8080806@semihalf.com> In-Reply-To: <4B2252BE.8080806@semihalf.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alexander Motin , freebsd-current@freebsd.org Subject: Re: 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 15:02:35 -0000 on 11/12/2009 16:10 Grzegorz Bernacki said the following: > 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); It seems that you are correct. The only confusing thing is that you supplied a reverse diff :) -- Andriy Gapon