This is a subtle behavior change. Before this change ocfs2 would keep this inode from being discovered and used while it was doing this because of I_WILL_FREE being set. However now we call ->drop_inode() before we drop the last i_count refcount, so we could potentially race here with somebody else and grab a reference to this inode. This isn't bad, the inode is still live and concurrent accesses will be safe. But we could potentially end up writing this inode multiple times if there are concurrent accesses while we're trying to drop the inode. Signed-off-by: Josef Bacik --- fs/ocfs2/inode.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 14bf440ea4df..d3c79d9a9635 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -1306,13 +1306,9 @@ int ocfs2_drop_inode(struct inode *inode) trace_ocfs2_drop_inode((unsigned long long)oi->ip_blkno, inode->i_nlink, oi->ip_flags); - assert_spin_locked(&inode->i_lock); - inode->i_state |= I_WILL_FREE; spin_unlock(&inode->i_lock); write_inode_now(inode, 1); spin_lock(&inode->i_lock); - WARN_ON(inode->i_state & I_NEW); - inode->i_state &= ~I_WILL_FREE; return 1; } -- 2.49.0