]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: Add reflinked file's inode to inode hash eariler.
authorTao Ma <tao.ma@oracle.com>
Fri, 18 Dec 2009 02:24:54 +0000 (10:24 +0800)
committerJoel Becker <joel.becker@oracle.com>
Fri, 18 Dec 2009 21:32:20 +0000 (13:32 -0800)
commit5321154d6acb7d22beb02c1d3d74d3d8465b2470
tree71d200fa3fddd6d98c39ecc48fd7b6ca10d91afc
parent5b57d1fb58d0cafa5d6bbe729515b6273d0b6589
ocfs2: Add reflinked file's inode to inode hash eariler.

We used to add reflinked file's inode to inode hash when
we add it to the dest dir. But actually there is a race.
Consider the following sequence.
1. reflink happens and create the inode in orphan dir.
2. reflink thread is scheduled out because of some io.
3. recovery begins to work and calls ocfs2_recover_orphans.
   It calls ocfs2_iget and get a new inode and i_count = 1.
   It calls iput then and delete inode. the buffer's
   uptodate state is cleared.

This patch move insert_inode_hash to the create function so
that it can be found by step 3 and prevented from deleting
because i_count > 1.

This resolves the bug
http://oss.oracle.com/bugzilla/show_bug.cgi?id=1183.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
fs/ocfs2/namei.c