lkml.org 
[lkml]   [2018]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] ovl: set I_CREATING on inode being created
On Wed, Aug 22, 2018 at 1:55 AM Miklos Szeredi <miklos@szeredi.hu> wrote:
>
> + spin_lock(&inode->i_lock);
> + inode->i_state |= I_CREATING;
> + spin_unlock(&inode->i_lock);
> +

Why is that spinlock protection there?

Isn't this a new inode that cannot possibly be reached any other way yet?

NOTE! This is a question. Maybe there is something I missed, and there
*are* other ways to reach that inode. But if that's true, isn't it
already too late to set I_CREATING?

So I'd like some clarification on this point before applying it. It's
possible that the spinlock is required, I just want to understand why.

Linus

\
 
 \ /
  Last update: 2018-08-22 16:54    [W:0.048 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site