mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: lock held returning to user space (i_mutex_dir_key)
Date: Tue, 10 Sep 2013 17:04:25 -0400	[thread overview]
Message-ID: <20130910210425.GB15371@redhat.com> (raw)
In-Reply-To: <20130910210237.GA15371@redhat.com>

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);
 

  reply	other threads:[~2013-09-10 21:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 21:02 Dave Jones
2013-09-10 21:04 ` Dave Jones [this message]
2013-09-10 21:09   ` Al Viro
2013-09-12 16:45   ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130910210425.GB15371@redhat.com \
    --to=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome