lkml.org 
[lkml]   [2017]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] VFS: close race between getcwd() and d_move()
On Thu, Nov 09, 2017 at 01:41:24PM +0200, Nikolay Borisov wrote:
> On 9.11.2017 05:22, NeilBrown wrote:
> > @@ -493,12 +496,18 @@ void __d_drop(struct dentry *dentry)
> > } else
> > hlist_bl_lock(b);
> > __hlist_bl_del(&dentry->d_hash);
> > - dentry->d_hash.pprev = NULL;
> > + if (likely(!moving))
> > + dentry->d_hash.pprev = NULL;
>
> nit: isn't a bit more explicit if (unlikely(moving)). I suspect the end
> result is the same, however it's easy to miss the !. It's not a big deal
> but just wondering.

umm ... you just suggested the exact opposite of what the patch is
intended to do. likely()/unlikely() only hint to the compiler the
probabilities of the branch; they don't change the meaning of the
condition.

\
 
 \ /
  Last update: 2017-11-09 14:09    [W:0.152 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site