X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n4UG7LdH150902 for ; Sat, 30 May 2009 11:07:21 -0500 X-ASG-Debug-ID: 1243699655-5e1d03680000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from one.firstfloor.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3ACFC2AF0B2 for ; Sat, 30 May 2009 09:07:36 -0700 (PDT) Received: from one.firstfloor.org (one.firstfloor.org [213.235.205.2]) by cuda.sgi.com with ESMTP id RL6hLYocBxnGCHug for ; Sat, 30 May 2009 09:07:36 -0700 (PDT) Received: by one.firstfloor.org (Postfix, from userid 503) id 4235D1AB0002; Sat, 30 May 2009 18:14:26 +0200 (CEST) Date: Sat, 30 May 2009 18:14:25 +0200 From: Andi Kleen To: Felix Blyakher Cc: Andi Kleen , Christoph Hellwig , Hedi Berriche , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs: prevent deadlock in xfs_qm_shake() Subject: Re: [PATCH] xfs: prevent deadlock in xfs_qm_shake() Message-ID: <20090530161425.GO1065@one.firstfloor.org> References: <1243620631-10749-1-git-send-email-felixb@sgi.com> <1243620631-10749-2-git-send-email-felixb@sgi.com> <20090529192529.GA1599@infradead.org> <87d49qeuqd.fsf@basil.nowhere.org> <1A09BC73-E1E8-4EF4-AD29-FB93556C3E3B@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1A09BC73-E1E8-4EF4-AD29-FB93556C3E3B@sgi.com> User-Agent: Mutt/1.4.2.1i X-Barracuda-Connect: one.firstfloor.org[213.235.205.2] X-Barracuda-Start-Time: 1243699657 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.27144 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Sat, May 30, 2009 at 09:57:20AM -0500, Felix Blyakher wrote: > > (gfp_mask & __GFP_WAIT && gfp_mask & __GFP_FS) != 0 or as Andi noted > (gfp_mask & (__GFP_WAIT|__GFP_FS)) == (__GFP_WAIT|__GFP_FS) > > I'd prefer the former, as in my original patch. > > Also, I accidentally put an extra open brace in a statement. After a > successful build I started playing with braces for more readability, > and left it in inconsistent state. > Seems like the preferred style in the kernel is as following: > > return ((gfp_mask & __GFP_WAIT) && (gfp_mask & __GFP_FS)) != 0; I would say it is return (gfp_mask & __GFP_WAIT) && (gfp_mask & __GFP_FS); The != 0 is completely superfluous. -Andi -- ak@linux.intel.com -- Speaking for myself only.