[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170131085542.GI6881@mwanda>
Date: Tue, 31 Jan 2017 11:55:42 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: James Simmons <jsimmons@...radead.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org,
Andreas Dilger <andreas.dilger@...el.com>,
Oleg Drokin <oleg.drokin@...el.com>,
Fan Yong <fan.yong@...el.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Lustre Development List <lustre-devel@...ts.lustre.org>
Subject: Re: [PATCH 22/60] staging: lustre: fid: fix race in fid allocation
On Sat, Jan 28, 2017 at 07:04:50PM -0500, James Simmons wrote:
> - if (!fid_is_zero(&seq->lcs_fid) &&
> - fid_oid(&seq->lcs_fid) < seq->lcs_width) {
> + if (unlikely(!fid_is_zero(&seq->lcs_fid) &&
> + fid_oid(&seq->lcs_fid) < seq->lcs_width)) {
What does adding an unlikely have to do with the race condition? Also
only add likely/unlikely when it makes a difference to benchmarks.
Otherwise leave it out.
> /* Just bump last allocated fid and return to caller. */
> - seq->lcs_fid.f_oid += 1;
> + seq->lcs_fid.f_oid++;
Ok... I'm pretty sure the compiler can figure this out on its own.
Stop mixing white space changes into your bug fixes. It just makes
reviewing more complicated.
> rc = 0;
> break;
> }
>
regards,
dan carpenter
Powered by blists - more mailing lists