LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jeff Mahoney <jeffm@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Brownell <david-b@pacbell.net>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	reiserfs-dev@namesys.com
Subject: Re: 2.6.21 reiserfs -- cicular locking?
Date: Fri, 27 Apr 2007 19:01:16 +0200	[thread overview]
Message-ID: <s5h7irxda5f.wl%tiwai@suse.de> (raw)
In-Reply-To: <463222F5.7080209@suse.de>

At Fri, 27 Apr 2007 12:21:09 -0400,
Jeff Mahoney wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Jeff Mahoney wrote:
> > Takashi Iwai wrote:
> >>> At Fri, 27 Apr 2007 07:09:01 -0400,
> >>> Jeff Mahoney wrote:
> >>>> -----BEGIN PGP SIGNED MESSAGE-----
> >>>> Hash: SHA1
> >>>>
> >>>> Takashi Iwai wrote:
> >>>>> At Fri, 27 Apr 2007 12:09:03 +0200,
> >>>>> I wrote:
> >>>>>> I got a similar bug right now at the fresh boot of 2.6.21.
> >>>>>>
> >>>>>>
> >>>>>> ReiserFS: sda2: found reiserfs format "3.6" with standard journal
> >>>>>> ReiserFS: sda2: using ordered data mode
> >>>>>> ReiserFS: sda2: journal params: device sda2, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
> >>>>>> ReiserFS: sda2: checking transaction log (sda2)
> >>>>>> ReiserFS: sda2: Using r5 hash to sort names
> >>>>>> ReiserFS: sda2: Removing [3613 1354701 0x0 SD]..done
> >>>>>> ReiserFS: sda2: There were 1 uncompleted unlinks/truncates. Completed
> >>>>>>
> >>>>>> =======================================================
> >>>>>> [ INFO: possible circular locking dependency detected ]
> >>>>>> 2.6.21-work #1
> >>>>>> -------------------------------------------------------
> >>>>>> mktemp/1459 is trying to acquire lock:
> >>>>>>  (&REISERFS_I(inode)->xattr_sem){..--}, at: [<e08a5236>] reiserfs_cache_default_acl+0x2a/0x9c [reiserfs]
> >>>>>>
> >>>>>> but task is already holding lock:
> >>>>>>  (&inode->i_mutex){--..}, at: [<c016d7dc>] open_namei+0xe2/0x5a2
> >>>>>>
> >>>>>> which lock already depends on the new lock.
> >>>>> The message disappears when I revert the patch:
> >>>>>
> >>>>> commit 9b7f375505f5611efb562065b57814b28a81abc3
> >>>>> Author: Jeff Mahoney <jeffm@suse.com>
> >>>>> Date:   Mon Apr 23 14:41:17 2007 -0700
> >>>>>
> >>>>>     reiserfs: fix xattr root locking/refcount bug
> >>>>>     
> >>>>>
> >>>>> So, likely a newly introduced bug after rc7...
> >>>> I got a message with a trace similar to this from Vladimir before I
> >>>> submitted that patch. I'm not sure how to annotate this, since the
> >>>> xattr_sem can never be taken in the manner described. Internal inodes
> >>>> are protected by I_PRIVATE.
> >>> Hm, then maybe my case was just a coincidence.
> >>>
> >>> FWIW, I can reproduce the deadlock warning at each time I boot
> >>> non-patched 2.6.21, and after reverting the patch, it disappeared.
> > 
> > Ok, so I took another look at the report Vladimir sent me. The trace he
> > ran into was in the delete inode path, but was still a race between the
> > xattr_sem and the inode sem. Since we're locking the xattr root on the
> > xattr read path now, this condition arises more freqently, but it's
> > really the same one he reported.
> > 
> > I'm using the default openSUSE config, which doesn't enable mutex
> > debugging. I'll rebuild with it, and hopefully come up with a way to
> > kill the warning.
> 
> I still didn't get the warning, but can you try this and let me know
> if it fixes it?

Yes, it seems to fix the problem.


Thanks,

Takashi

> 
> - -Jeff
> 
> - --- a/fs/reiserfs/xattr.c	2007-04-22 10:53:10.000000000 -0400
> +++ b/fs/reiserfs/xattr.c	2007-04-27 12:09:02.000000000 -0400
> @@ -68,7 +68,7 @@
>  	if (!privroot)
>  		return ERR_PTR(-ENODATA);
>  
> - -	mutex_lock(&privroot->d_inode->i_mutex);
> +	mutex_lock_nested(&privroot->d_inode->i_mutex, I_MUTEX_XATTR);
>  	if (REISERFS_SB(sb)->xattr_root) {
>  		xaroot = dget(REISERFS_SB(sb)->xattr_root);
>  		goto out;
> 
> - -- 
> Jeff Mahoney
> SUSE Labs
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (GNU/Linux)
> Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
> 
> iD8DBQFGMiL1LPWxlyuTD7IRAuwoAKCob0DLVBcmeOApOr9vA5cVFRwBewCfTU/U
> jwIjK+Uy4RfXKsag5Uamzew=
> =svba
> -----END PGP SIGNATURE-----
> 

  reply	other threads:[~2007-04-27 17:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-26 23:40 David Brownell
2007-04-27  5:44 ` Andrew Morton
2007-04-27 10:09   ` Takashi Iwai
2007-04-27 10:53     ` Takashi Iwai
2007-04-27 11:09       ` Jeff Mahoney
2007-04-27 12:20         ` Takashi Iwai
2007-04-27 15:17           ` Jeff Mahoney
2007-04-27 16:21             ` Jeff Mahoney
2007-04-27 17:01               ` Takashi Iwai [this message]
2007-04-27 17:11               ` Antonino A. Daplas

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=s5h7irxda5f.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=david-b@pacbell.net \
    --cc=jeffm@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reiserfs-dev@namesys.com \
    --subject='Re: 2.6.21 reiserfs -- cicular locking?' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).