Skip to content

Commit

Permalink
ovl: set I_CREATING on inode being created
Browse files Browse the repository at this point in the history
...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 <mszeredi@redhat.com>
Fixes: e950564 ("vfs: don't evict uninitialized inode")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Aug 22, 2018
1 parent cd9b44f commit 6faf05c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/overlayfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,10 @@ static int ovl_create_object(struct dentry *dentry, int mode, dev_t rdev,
if (!inode)
goto out_drop_write;

spin_lock(&inode->i_lock);
inode->i_state |= I_CREATING;
spin_unlock(&inode->i_lock);

inode_init_owner(inode, dentry->d_parent->d_inode, mode);
attr.mode = inode->i_mode;

Expand Down

0 comments on commit 6faf05c

Please sign in to comment.