[Top] [All Lists]

Re: [PATCH] xfs: prevent deadlock in xfs_qm_shake()

To: Felix Blyakher <felixb@xxxxxxx>
Subject: Re: [PATCH] xfs: prevent deadlock in xfs_qm_shake()
From: Andi Kleen <andi@xxxxxxxxxxxxxx>
Date: Sat, 30 May 2009 18:14:25 +0200
Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Hedi Berriche <hedi@xxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <1A09BC73-E1E8-4EF4-AD29-FB93556C3E3B@xxxxxxx>
References: <1243620631-10749-1-git-send-email-felixb@xxxxxxx> <1243620631-10749-2-git-send-email-felixb@xxxxxxx> <20090529192529.GA1599@xxxxxxxxxxxxx> <87d49qeuqd.fsf@xxxxxxxxxxxxxxxxx> <1A09BC73-E1E8-4EF4-AD29-FB93556C3E3B@xxxxxxx>
User-agent: Mutt/
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.


ak@xxxxxxxxxxxxxxx -- Speaking for myself only.

<Prev in Thread] Current Thread [Next in Thread>