Re: [PATCH] ovl: set I_CREATING on inode being created

2018-08-22 Thread Linus Torvalds
On Wed, Aug 22, 2018 at 12:58 PM Miklos Szeredi wrote: > > > 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. > > I added the spinlock, because it's cheap (new_inode() already pulls it > into L1 cache)

Re: [PATCH] ovl: set I_CREATING on inode being created

2018-08-22 Thread Miklos Szeredi
On Wed, Aug 22, 2018 at 4:53 PM, Linus Torvalds wrote: > On Wed, Aug 22, 2018 at 1:55 AM Miklos Szeredi 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

Re: [PATCH] ovl: set I_CREATING on inode being created

2018-08-22 Thread Linus Torvalds
On Wed, Aug 22, 2018 at 1:55 AM Miklos Szeredi 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!

[PATCH] ovl: set I_CREATING on inode being created

2018-08-22 Thread Miklos Szeredi
...otherwise there will be list corruption due to inode_sb_list_add() being called for inode already on the sb list. Signed-off-by: Miklos Szeredi Fixes: e950564b97fd ("vfs: don't evict uninitialized inode") --- This missed the 4.19 overlay pull request, because it fixes a bug introduced by patch