The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Srinivasa Ds <srinivasa@in.ibm.com>
To: Tomasz Kvarsin <kvarsin@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	jfs-discussion@lists.sourceforge.net, shaggy@austin.ibm.com,
	Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>
Subject: Re: JFS: possible recursive locking detected
Date: Tue, 09 Jan 2007 15:02:47 +0530	[thread overview]
Message-ID: <45A3613F.1050604@in.ibm.com> (raw)
In-Reply-To: <5157576d0701082333h276b99f3l7a785f6e2f250c27@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1734 bytes --]

Tomasz Kvarsin wrote:
> This I got during boot with 2.6.20-rc4:
> =============================================
> [ INFO: possible recursive locking detected ]
> 2.6.20-rc4 #3
> ---------------------------------------------
> mount/5819 is trying to acquire lock:
> (&jfs_ip->commit_mutex){--..}, at: [<c03395e1>] mutex_lock+0x21/0x30
>
> but task is already holding lock:
> (&jfs_ip->commit_mutex){--..}, at: [<c03395e1>] mutex_lock+0x21/0x30
>
> other info that might help us debug this:
> 2 locks held by mount/5819:
> #0:  (&inode->i_mutex){--..}, at: [<c03395e1>] mutex_lock+0x21/0x30
> #1:  (&jfs_ip->commit_mutex){--..}, at: [<c03395e1>] mutex_lock+0x21/0x30
>
Problem was in jfs_create(), it was calling 2 mutex_calls.
=============================================
static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
                struct nameidata *nd)
{
        int rc = 0;
        tid_t tid;              /* transaction id */
        struct inode *ip = NULL;        /* child directory inode */
        ino_t ino;
        struct component_name dname;    /* child directory name */
        struct btstack btstack;
        struct inode *iplist[2];
        struct tblock *tblk;

        jfs_info("jfs_create: dip:0x%p name:%s", dip, dentry->d_name.name);
      .....................................
       tid = txBegin(dip->i_sb, 0);

        mutex_lock(&JFS_IP(dip)->commit_mutex);
        mutex_lock(&JFS_IP(ip)->commit_mutex);

        rc = jfs_init_acl(tid, ip, dip);
        if (rc)
                goto out3;
=======================================

So below patch should fix this problem,please test this. Let me know 
your comments on this.

Signed-off-by: Srinivasa DS <srinivasa@in.ibm.com>



[-- Attachment #2: jfs.fix --]
[-- Type: text/plain, Size: 609 bytes --]

 namei.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.20-rc4/fs/jfs/namei.c
===================================================================
--- linux-2.6.20-rc4.orig/fs/jfs/namei.c
+++ linux-2.6.20-rc4/fs/jfs/namei.c
@@ -104,8 +104,8 @@ static int jfs_create(struct inode *dip,
 
 	tid = txBegin(dip->i_sb, 0);
 
-	mutex_lock(&JFS_IP(dip)->commit_mutex);
-	mutex_lock(&JFS_IP(ip)->commit_mutex);
+	mutex_lock_nested(&JFS_IP(dip)->commit_mutex, I_MUTEX_PARENT);
+	mutex_lock_nested(&JFS_IP(ip)->commit_mutex, I_MUTEX_CHILD);
 
 	rc = jfs_init_acl(tid, ip, dip);
 	if (rc)

  reply	other threads:[~2007-01-09  8:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-09  7:33 JFS: possible recursive locking detected Tomasz Kvarsin
2007-01-09  9:32 ` Srinivasa Ds [this message]
2007-01-09 13:56   ` Dave Kleikamp
2007-01-09 18:05     ` [PATCH] " Dave Kleikamp

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=45A3613F.1050604@in.ibm.com \
    --to=srinivasa@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=kvarsin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaggy@austin.ibm.com \
    --cc=torvalds@osdl.org \
    /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