[Ocfs2-devel] [patch V2] ocfs2: fix a tiny race when running dirop_fileop_racer

Mark Fasheh mfasheh at suse.de
Fri Jun 13 14:19:58 PDT 2014


On Fri, Jun 13, 2014 at 04:51:33PM +0800, jiangyiwen wrote:
> When running dirop_fileop_racer we found a dead lock case.
> 
> 2 nodes, say Node A and Node B, mount the same ocfs2 volume.  Create
> /race/16/1 in the filesystem, and let the inode number of dir 16 is less
> than the inode number of dir race.
> 
> Node A                            Node B
> mv /race/16/1 /race/
>                                   right after Node A has got the
>                                   EX mode of /race/16/, and tries to
>                                   get EX mode of /race
>                                   ls /race/16/
> 
> In this case, Node A has got the EX mode of /race/16/, and wants to get EX
> mode of /race/.  Node B has got the PR mode of /race/, and wants to get
> the PR mode of /race/16/.  Since EX and PR are mutually exclusive, dead
> lock happens.
> 
> This patch fixes this case by locking in ancestor order before trying
> inode number order.
> 
> Signed-off-by: Yiwen Jiang <jiangyiwen at huawei.com>
> Signed-off-by: Joseph Qi <joseph.qi at huawei.com>
> Signed-off-by: Andrew Morton <akpm at linux-foundation.org>

Reviewed-by: Mark Fasheh <mfasheh at suse.de>
	--Mark

--
Mark Fasheh



More information about the Ocfs2-devel mailing list