Linux kernel -stable discussions
 help / color / mirror / Atom feed
* + ocfs2-mknod-fix-recursive-locking-hung.patch added to -mm tree
@ 2017-10-18 22:18 akpm
  2017-10-19  1:12 ` Junxiao Bi
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2017-10-18 22:18 UTC (permalink / raw)
  To: junxiao.bi, ghe, jiangqi903, jlbec, mfasheh, stable, mm-commits


The patch titled
     Subject: ocfs2: mknod: fix recursive locking hung
has been added to the -mm tree.  Its filename is
     ocfs2-mknod-fix-recursive-locking-hung.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-mknod-fix-recursive-locking-hung.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-mknod-fix-recursive-locking-hung.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Junxiao Bi <junxiao.bi@oracle.com>
Subject: ocfs2: mknod: fix recursive locking hung

Here another recursive lock caught and it caused a cluster hung.

 #0 [ffff88008e3935a8] __schedule at ffffffff816e4722
 #1 [ffff88008e393600] schedule at ffffffff816e4dee
 #2 [ffff88008e393620] schedule_timeout at ffffffff816e7cd5
 #3 [ffff88008e3936c0] wait_for_completion at ffffffff816e631f
 #4 [ffff88008e393740] __ocfs2_cluster_lock at ffffffffa05a9111 [ocfs2]
 #5 [ffff88008e393890] ocfs2_inode_lock_full_nested at ffffffffa05aec14 [ocfs2]
 #6 [ffff88008e393910] ocfs2_inode_lock_tracker at ffffffffa05af02f [ocfs2]
 #7 [ffff88008e393970] ocfs2_iop_get_acl at ffffffffa0620c92 [ocfs2]
 #8 [ffff88008e3939d0] get_acl at ffffffff8126ae79
 #9 [ffff88008e3939f0] posix_acl_create at ffffffff8126b27a
 #10 [ffff88008e393a20] ocfs2_mknod at ffffffffa05cedcc [ocfs2]
 #11 [ffff88008e393b60] ocfs2_create at ffffffffa05cfb13 [ocfs2]
 #12 [ffff88008e393bd0] vfs_create at ffffffff81217338
 #13 [ffff88008e393c10] lookup_open at ffffffff81217a85
 #14 [ffff88008e393ca0] do_last at ffffffff8121ac6d
 #15 [ffff88008e393d30] path_openat at ffffffff8121b112
 #16 [ffff88008e393df0] do_filp_open at ffffffff8121b53a
 #17 [ffff88008e393ed0] do_sys_open at ffffffff81209a5a
 #18 [ffff88008e393f40] sys_open at ffffffff81209bae
 #19 [ffff88008e393f50] system_call_fastpath at ffffffff816e902e

inode lock is got by ocfs2_mknod() before call into posix_acl_create().

Link: http://lkml.kernel.org/r/1508300302-5155-1-git-send-email-junxiao.bi@oracle.com
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mfasheh@versity.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <jiangqi903@gmail.com>
Cc: Gang He <ghe@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/ocfs2/namei.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff -puN fs/ocfs2/namei.c~ocfs2-mknod-fix-recursive-locking-hung fs/ocfs2/namei.c
--- a/fs/ocfs2/namei.c~ocfs2-mknod-fix-recursive-locking-hung
+++ a/fs/ocfs2/namei.c
@@ -260,6 +260,8 @@ static int ocfs2_mknod(struct inode *dir
 	sigset_t oldset;
 	int did_block_signals = 0;
 	struct ocfs2_dentry_lock *dl = NULL;
+	int locked;
+	struct ocfs2_lock_holder oh;
 
 	trace_ocfs2_mknod(dir, dentry, dentry->d_name.len, dentry->d_name.name,
 			  (unsigned long long)OCFS2_I(dir)->ip_blkno,
@@ -274,11 +276,11 @@ static int ocfs2_mknod(struct inode *dir
 	/* get our super block */
 	osb = OCFS2_SB(dir->i_sb);
 
-	status = ocfs2_inode_lock(dir, &parent_fe_bh, 1);
-	if (status < 0) {
-		if (status != -ENOENT)
-			mlog_errno(status);
-		return status;
+	locked = ocfs2_inode_lock_tracker(dir, &parent_fe_bh, 1, &oh);
+	if (locked < 0) {
+		if (locked != -ENOENT)
+			mlog_errno(locked);
+		return locked;
 	}
 
 	if (S_ISDIR(mode) && (dir->i_nlink >= ocfs2_link_max(osb))) {
@@ -462,7 +464,7 @@ leave:
 	if (handle)
 		ocfs2_commit_trans(osb, handle);
 
-	ocfs2_inode_unlock(dir, 1);
+	ocfs2_inode_unlock_tracker(dir, 1, &oh, locked);
 	if (did_block_signals)
 		ocfs2_unblock_signals(&oldset);
 
_

Patches currently in -mm which might be from junxiao.bi@oracle.com are

ocfs2-mknod-fix-recursive-locking-hung.patch

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: + ocfs2-mknod-fix-recursive-locking-hung.patch added to -mm tree
  2017-10-18 22:18 + ocfs2-mknod-fix-recursive-locking-hung.patch added to -mm tree akpm
@ 2017-10-19  1:12 ` Junxiao Bi
  0 siblings, 0 replies; 2+ messages in thread
From: Junxiao Bi @ 2017-10-19  1:12 UTC (permalink / raw)
  To: akpm, ghe, jiangqi903, jlbec, mfasheh, stable, mm-commits

Hi Andrew,

Please drop this patch. I just found upstream had fixed this issue in
commit c25a1e0671fb ("ocfs2: fix posix_acl_create deadlock"). This issue
was caught on an internal old kernel.

Thanks,
Junxiao.

On 10/19/2017 06:18 AM, akpm@linux-foundation.org wrote:
> 
> The patch titled
>      Subject: ocfs2: mknod: fix recursive locking hung
> has been added to the -mm tree.  Its filename is
>      ocfs2-mknod-fix-recursive-locking-hung.patch
> 
> This patch should soon appear at
>     http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-mknod-fix-recursive-locking-hung.patch
> and later at
>     http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-mknod-fix-recursive-locking-hung.patch
> 
> Before you just go and hit "reply", please:
>    a) Consider who else should be cc'ed
>    b) Prefer to cc a suitable mailing list as well
>    c) Ideally: find the original patch on the mailing list and do a
>       reply-to-all to that, adding suitable additional cc's
> 
> *** Remember to use Documentation/SubmitChecklist when testing your code ***
> 
> The -mm tree is included into linux-next and is updated
> there every 3-4 working days
> 
> ------------------------------------------------------
> From: Junxiao Bi <junxiao.bi@oracle.com>
> Subject: ocfs2: mknod: fix recursive locking hung
> 
> Here another recursive lock caught and it caused a cluster hung.
> 
>  #0 [ffff88008e3935a8] __schedule at ffffffff816e4722
>  #1 [ffff88008e393600] schedule at ffffffff816e4dee
>  #2 [ffff88008e393620] schedule_timeout at ffffffff816e7cd5
>  #3 [ffff88008e3936c0] wait_for_completion at ffffffff816e631f
>  #4 [ffff88008e393740] __ocfs2_cluster_lock at ffffffffa05a9111 [ocfs2]
>  #5 [ffff88008e393890] ocfs2_inode_lock_full_nested at ffffffffa05aec14 [ocfs2]
>  #6 [ffff88008e393910] ocfs2_inode_lock_tracker at ffffffffa05af02f [ocfs2]
>  #7 [ffff88008e393970] ocfs2_iop_get_acl at ffffffffa0620c92 [ocfs2]
>  #8 [ffff88008e3939d0] get_acl at ffffffff8126ae79
>  #9 [ffff88008e3939f0] posix_acl_create at ffffffff8126b27a
>  #10 [ffff88008e393a20] ocfs2_mknod at ffffffffa05cedcc [ocfs2]
>  #11 [ffff88008e393b60] ocfs2_create at ffffffffa05cfb13 [ocfs2]
>  #12 [ffff88008e393bd0] vfs_create at ffffffff81217338
>  #13 [ffff88008e393c10] lookup_open at ffffffff81217a85
>  #14 [ffff88008e393ca0] do_last at ffffffff8121ac6d
>  #15 [ffff88008e393d30] path_openat at ffffffff8121b112
>  #16 [ffff88008e393df0] do_filp_open at ffffffff8121b53a
>  #17 [ffff88008e393ed0] do_sys_open at ffffffff81209a5a
>  #18 [ffff88008e393f40] sys_open at ffffffff81209bae
>  #19 [ffff88008e393f50] system_call_fastpath at ffffffff816e902e
> 
> inode lock is got by ocfs2_mknod() before call into posix_acl_create().
> 
> Link: http://lkml.kernel.org/r/1508300302-5155-1-git-send-email-junxiao.bi@oracle.com
> Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
> Cc: Mark Fasheh <mfasheh@versity.com>
> Cc: Joel Becker <jlbec@evilplan.org>
> Cc: Joseph Qi <jiangqi903@gmail.com>
> Cc: Gang He <ghe@suse.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  fs/ocfs2/namei.c |   14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff -puN fs/ocfs2/namei.c~ocfs2-mknod-fix-recursive-locking-hung fs/ocfs2/namei.c
> --- a/fs/ocfs2/namei.c~ocfs2-mknod-fix-recursive-locking-hung
> +++ a/fs/ocfs2/namei.c
> @@ -260,6 +260,8 @@ static int ocfs2_mknod(struct inode *dir
>  	sigset_t oldset;
>  	int did_block_signals = 0;
>  	struct ocfs2_dentry_lock *dl = NULL;
> +	int locked;
> +	struct ocfs2_lock_holder oh;
>  
>  	trace_ocfs2_mknod(dir, dentry, dentry->d_name.len, dentry->d_name.name,
>  			  (unsigned long long)OCFS2_I(dir)->ip_blkno,
> @@ -274,11 +276,11 @@ static int ocfs2_mknod(struct inode *dir
>  	/* get our super block */
>  	osb = OCFS2_SB(dir->i_sb);
>  
> -	status = ocfs2_inode_lock(dir, &parent_fe_bh, 1);
> -	if (status < 0) {
> -		if (status != -ENOENT)
> -			mlog_errno(status);
> -		return status;
> +	locked = ocfs2_inode_lock_tracker(dir, &parent_fe_bh, 1, &oh);
> +	if (locked < 0) {
> +		if (locked != -ENOENT)
> +			mlog_errno(locked);
> +		return locked;
>  	}
>  
>  	if (S_ISDIR(mode) && (dir->i_nlink >= ocfs2_link_max(osb))) {
> @@ -462,7 +464,7 @@ leave:
>  	if (handle)
>  		ocfs2_commit_trans(osb, handle);
>  
> -	ocfs2_inode_unlock(dir, 1);
> +	ocfs2_inode_unlock_tracker(dir, 1, &oh, locked);
>  	if (did_block_signals)
>  		ocfs2_unblock_signals(&oldset);
>  
> _
> 
> Patches currently in -mm which might be from junxiao.bi@oracle.com are
> 
> ocfs2-mknod-fix-recursive-locking-hung.patch
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-19  1:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-18 22:18 + ocfs2-mknod-fix-recursive-locking-hung.patch added to -mm tree akpm
2017-10-19  1:12 ` Junxiao Bi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox