]> Git Repo - linux.git/commit
ocfs2: fix a tiny case that inode can not removed
authorYiwen Jiang <[email protected]>
Fri, 4 Sep 2015 22:44:25 +0000 (15:44 -0700)
committerLinus Torvalds <[email protected]>
Fri, 4 Sep 2015 23:54:41 +0000 (16:54 -0700)
commit928dda1f9433f024ac48c3d97ae683bf83dd0e42
tree7a37ba09ba3363eecf2bba5939c29a029bf605fc
parent6ab855a99b735c227ad1e0deda636833f41c5b87
ocfs2: fix a tiny case that inode can not removed

When running dirop_fileop_racer we found a case that inode
can not removed.

Two nodes, say Node A and Node B, mount the same ocfs2 volume.  Create
two dirs /race/1/ and /race/2/ in the filesystem.

  Node A                            Node B
  rm -r /race/2/
                                    mv /race/1/ /race/2/
  call ocfs2_unlink(), get
  the EX mode of /race/2/
                                    wait for B unlock /race/2/
  decrease i_nlink of /race/2/ to 0,
  and add inode of /race/2/ into
  orphan dir, unlock /race/2/
                                    got EX mode of /race/2/. because
                                    /race/1/ is dir, so inc i_nlink
                                    of /race/2/ and update into disk,
                                    unlock /race/2/
  because i_nlink of /race/2/
  is not zero, this inode will
  always remain in orphan dir

This patch fixes this case by test whether i_nlink of new dir is zero.

Signed-off-by: Yiwen Jiang <[email protected]>
Reviewed-by: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Cc: Joseph Qi <[email protected]>
Cc: Xue jiufei <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/ocfs2/namei.c
This page took 0.054226 seconds and 4 git commands to generate.