From mboxrd@z Thu Jan 1 00:00:00 1970 From: Neil Brown Subject: Re: [PATCH] md: bitwise operations might not fit in a "bool" Date: Thu, 22 Jul 2010 22:37:40 +1000 Message-ID: <20100722223740.7baa68a1@notabene> References: <4C47ED7B.1050709@gmail.com> <20100722173716.66264bef@notabene> <4C481FD5.4070509@gmail.com> <4C482F35.6000004@panasas.com> <20100722215555.7ab2b1ee@notabene> <4C4837A5.6040209@panasas.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4C4837A5.6040209@panasas.com> Sender: linux-raid-owner@vger.kernel.org To: Boaz Harrosh Cc: Christoph Hellwig , Jiri Slaby , James Bottomley , linux-scsi@vger.kernel.org, hch@lst.de, jaxboe@fusionio.com, LKML , linux-raid@vger.kernel.org List-Id: linux-raid.ids On Thu, 22 Jul 2010 15:20:53 +0300 Boaz Harrosh wrote: > On 07/22/2010 02:55 PM, Neil Brown wrote: > > On Thu, 22 Jul 2010 14:44:53 +0300 > > Boaz Harrosh wrote: > > > >> > >> when taking a resolute of a bit-wise AND as true false. Better / faster > >> to make it a boolean operation. > >> > >> This fixes a bug and a crash because the flags field did not fit into > >> the bool operands. > > > > No, that won't work. > > Read the rest of the code and see where 'do_sync' and 'do_barriers' are used. > > > > NeilBrown > > > > You are right! (I didn't look) > > the use of "bool" was wrong from the get go. it was never a bool operation. > What was the guy thinking? What is that do_XXX name? that name should change > as well. Perhaps flg_sync, flg_barriers. Check the git history - 'bool' was originally appropriate. But when the value was recently changed, the type and name were not. I would actually prefer "sync_flg" and "barrier_flg", but your suggestion that we change the name as well as the type is a good one. Thanks, NeilBrown