Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754763Ab3ILQph (ORCPT ); Thu, 12 Sep 2013 12:45:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53324 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753636Ab3ILQpg (ORCPT ); Thu, 12 Sep 2013 12:45:36 -0400 Date: Thu, 12 Sep 2013 12:45:32 -0400 From: Jeff Layton To: Dave Jones Cc: Linus Torvalds , Al Viro , Linux Kernel Subject: Re: lock held returning to user space (i_mutex_dir_key) Message-ID: <20130912124532.308675fd@tlielax.poochiereds.net> In-Reply-To: <20130910210425.GB15371@redhat.com> References: <20130910210237.GA15371@redhat.com> <20130910210425.GB15371@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1599 Lines: 51 On Tue, 10 Sep 2013 17:04:25 -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: [] mountpoint_last+0x4e/0x1a0 > > This perhaps ? > > > -- > > Add missing unlocks to error paths of mountpoint_last. > > Signed-off-by: Dave Jones > > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/