]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: fix posix_acl_create deadlock
authorJunxiao Bi <junxiao.bi@oracle.com>
Thu, 12 May 2016 22:42:18 +0000 (15:42 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 May 2016 22:52:50 +0000 (15:52 -0700)
commit6436c1978a1ae4cb4a712d5b78ac25febfb4c021
tree568387253124f7f9aa738aea26f7964d048aa70b
parentbefdf1a241130e322608218909c0be1f1c250004
ocfs2: fix posix_acl_create deadlock

Commit ef577d6ba3d0 ("ocfs2: use generic posix ACL infrastructure")
refactored code to use posix_acl_create.  The problem with this function
is that it is not mindful of the cluster wide inode lock making it
unsuitable for use with ocfs2 inode creation with ACLs.  For example,
when used in ocfs2_mknod, this function can cause deadlock as follows.
The parent dir inode lock is taken when calling posix_acl_create ->
get_acl -> ocfs2_iop_get_acl which takes the inode lock again.  This can
cause deadlock if there is a blocked remote lock request waiting for the
lock to be downconverted.  And same deadlock happened in ocfs2_reflink.
This fix is to revert back using ocfs2_init_acl.

Fixes: ef577d6ba3d0 ("ocfs2: use generic posix ACL infrastructure")
Signed-off-by: Tariq Saeed <tariq.x.saeed@oracle.com>
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <joseph.qi@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/acl.c
fs/ocfs2/acl.h
fs/ocfs2/namei.c
fs/ocfs2/refcounttree.c
fs/ocfs2/xattr.c
fs/ocfs2/xattr.h