From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LynKM-0004Rq-3g for mharc-grub-devel@gnu.org; Tue, 28 Apr 2009 09:26:26 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LynKK-0004Qt-Fk for grub-devel@gnu.org; Tue, 28 Apr 2009 09:26:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LynKF-0004Pf-V3 for grub-devel@gnu.org; Tue, 28 Apr 2009 09:26:24 -0400 Received: from [199.232.76.173] (port=37569 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LynKF-0004Pc-Sy for grub-devel@gnu.org; Tue, 28 Apr 2009 09:26:19 -0400 Received: from c60.cesmail.net ([216.154.195.49]:15772) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1LynKF-00046W-Jn for grub-devel@gnu.org; Tue, 28 Apr 2009 09:26:19 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 28 Apr 2009 09:26:18 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id C539B34C6A for ; Tue, 28 Apr 2009 09:24:12 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <20090428.015929.115521917.davem@davemloft.net> References: <1240882672.29799.10.camel@mj> <20090427.184533.105744402.davem@davemloft.net> <1240890645.29799.99.camel@mj> <20090428.015929.115521917.davem@davemloft.net> Content-Type: text/plain Date: Tue, 28 Apr 2009 09:26:17 -0400 Message-Id: <1240925177.1136.4.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 (2.26.1-2.fc11) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Re: Revision 2136 breaks two-disk configuarion X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Apr 2009 13:26:24 -0000 On Tue, 2009-04-28 at 01:59 -0700, David Miller wrote: > I think it's overkill at the moment. I've committed the patch with grub_malloc() and the patch making grub_fs_uuid_close() use grub_device_close(). > > +/* Return partition to be freed if it can be freed. */ > > +static inline grub_partition_t > > +grub_partition_unref (const grub_partition_t p) > > +{ > > + if (p && p->refcount-- <= 0) > > + return p; > > If the reference count dips below zero, that should trigger > an assertion rather than giving the pointer to the caller > again which will potentially double-free memory or whatever. Correct. If we have a better case for using refcounts, we'll have that check. -- Regards, Pavel Roskin