All of lore.kernel.org
 help / color / mirror / Atom feed
* lock held returning to user space (i_mutex_dir_key)
@ 2013-09-10 21:02 Dave Jones
  2013-09-10 21:04 ` Dave Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Jones @ 2013-09-10 21:02 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Al Viro, Linux Kernel

================================================
[ BUG: lock held when returning to user space! ]
3.11.0+ #64 Not tainted
------------------------------------------------
trinity-child2/8333 is leaving the kernel with locks still held!
1 lock held by trinity-child2/8333:
 #0:  (&type->i_mutex_dir_key#3){+.+.+.}, at: [<ffffffff811c7fce>] mountpoint_last+0x4e/0x1a0




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

* Re: lock held returning to user space (i_mutex_dir_key)
  2013-09-10 21:02 lock held returning to user space (i_mutex_dir_key) Dave Jones
@ 2013-09-10 21:04 ` Dave Jones
  2013-09-10 21:09   ` Al Viro
  2013-09-12 16:45   ` Jeff Layton
  0 siblings, 2 replies; 4+ messages in thread
From: Dave Jones @ 2013-09-10 21:04 UTC (permalink / raw)
  To: Linus Torvalds, Al Viro, Linux Kernel

On Tue, Sep 10, 2013 at 05:02:37PM -0400, Dave Jones wrote:
 > ================================================
 > [ BUG: lock held when returning to user space! ]
 > 3.11.0+ #64 Not tainted
 > ------------------------------------------------
 > trinity-child2/8333 is leaving the kernel with locks still held!
 > 1 lock held by trinity-child2/8333:
 >  #0:  (&type->i_mutex_dir_key#3){+.+.+.}, at: [<ffffffff811c7fce>] mountpoint_last+0x4e/0x1a0

This perhaps ?


-- 

Add missing unlocks to error paths of mountpoint_last.

Signed-off-by: Dave Jones <davej@fedoraproject.org>

diff --git a/fs/namei.c b/fs/namei.c
index 409a441..5a91474 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2271,12 +2271,15 @@ mountpoint_last(struct nameidata *nd, struct path *path)
 		dentry = d_alloc(dir, &nd->last);
 		if (!dentry) {
 			error = -ENOMEM;
+			mutex_unlock(&dir->d_inode->i_mutex);
 			goto out;
 		}
 		dentry = lookup_real(dir->d_inode, dentry, nd->flags);
 		error = PTR_ERR(dentry);
-		if (IS_ERR(dentry))
+		if (IS_ERR(dentry)) {
+			mutex_unlock(&dir->d_inode->i_mutex);
 			goto out;
+		}
 	}
 	mutex_unlock(&dir->d_inode->i_mutex);
 

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

* Re: lock held returning to user space (i_mutex_dir_key)
  2013-09-10 21:04 ` Dave Jones
@ 2013-09-10 21:09   ` Al Viro
  2013-09-12 16:45   ` Jeff Layton
  1 sibling, 0 replies; 4+ messages in thread
From: Al Viro @ 2013-09-10 21:09 UTC (permalink / raw)
  To: Dave Jones, Linus Torvalds, Linux Kernel

On Tue, Sep 10, 2013 at 05:04:25PM -0400, Dave Jones wrote:
> On Tue, Sep 10, 2013 at 05:02:37PM -0400, Dave Jones wrote:
>  > ================================================
>  > [ BUG: lock held when returning to user space! ]
>  > 3.11.0+ #64 Not tainted
>  > ------------------------------------------------
>  > trinity-child2/8333 is leaving the kernel with locks still held!
>  > 1 lock held by trinity-child2/8333:
>  >  #0:  (&type->i_mutex_dir_key#3){+.+.+.}, at: [<ffffffff811c7fce>] mountpoint_last+0x4e/0x1a0
> 
> This perhaps ?

Applied

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

* Re: lock held returning to user space (i_mutex_dir_key)
  2013-09-10 21:04 ` Dave Jones
  2013-09-10 21:09   ` Al Viro
@ 2013-09-12 16:45   ` Jeff Layton
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2013-09-12 16:45 UTC (permalink / raw)
  To: Dave Jones; +Cc: Linus Torvalds, Al Viro, Linux Kernel

On Tue, 10 Sep 2013 17:04:25 -0400
Dave Jones <davej@redhat.com> wrote:

> On Tue, Sep 10, 2013 at 05:02:37PM -0400, Dave Jones wrote:
>  > ================================================
>  > [ BUG: lock held when returning to user space! ]
>  > 3.11.0+ #64 Not tainted
>  > ------------------------------------------------
>  > trinity-child2/8333 is leaving the kernel with locks still held!
>  > 1 lock held by trinity-child2/8333:
>  >  #0:  (&type->i_mutex_dir_key#3){+.+.+.}, at: [<ffffffff811c7fce>] mountpoint_last+0x4e/0x1a0  
> 
> This perhaps ?
> 
> 
> -- 
> 
> Add missing unlocks to error paths of mountpoint_last.
> 
> Signed-off-by: Dave Jones <davej@fedoraproject.org>
> 
> diff --git a/fs/namei.c b/fs/namei.c
> index 409a441..5a91474 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -2271,12 +2271,15 @@ mountpoint_last(struct nameidata *nd, struct path *path)
>  		dentry = d_alloc(dir, &nd->last);
>  		if (!dentry) {
>  			error = -ENOMEM;
> +			mutex_unlock(&dir->d_inode->i_mutex);
>  			goto out;
>  		}
>  		dentry = lookup_real(dir->d_inode, dentry, nd->flags);
>  		error = PTR_ERR(dentry);
> -		if (IS_ERR(dentry))
> +		if (IS_ERR(dentry)) {
> +			mutex_unlock(&dir->d_inode->i_mutex);
>  			goto out;
> +		}
>  	}
>  	mutex_unlock(&dir->d_inode->i_mutex);
>  

Well spotted.

Reviewed-by: Jeff Layton <jlayton@redhat.com>

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

end of thread, other threads:[~2013-09-12 16:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-10 21:02 lock held returning to user space (i_mutex_dir_key) Dave Jones
2013-09-10 21:04 ` Dave Jones
2013-09-10 21:09   ` Al Viro
2013-09-12 16:45   ` Jeff Layton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.