linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Blyakher <felixb@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Alexander Beregalov <a.beregalov@gmail.com>,
	"linux-next@vger.kernel.org" <linux-next@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	xfs@oss.sgi.com
Subject: Re: next-20090220: XFS: inconsistent lock state
Date: Tue, 3 Mar 2009 10:45:28 -0600	[thread overview]
Message-ID: <B793B976-694B-423B-AAF2-9A622696CC88@sgi.com> (raw)
In-Reply-To: <20090224200740.GA9266@infradead.org>

On Feb 24, 2009, at 2:07 PM, Christoph Hellwig wrote:

> On Fri, Feb 20, 2009 at 08:52:59PM +0300, Alexander Beregalov wrote:
>> Hi
>>
>> [ INFO: inconsistent lock state ]
>> 2.6.29-rc5-next-20090220 #2
>> ---------------------------------
>> inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-R} usage.
>> kswapd0/324 [HC0[0]:SC0[0]:HE1:SE1] takes:
>> (&(&ip->i_lock)->mr_lock){+++++?}, at: [<ffffffff803ca60a>]
>> xfs_ilock+0xaa/0x120
>> {RECLAIM_FS-ON-W} state was registered at:
>
> That's a false positive.  While the ilock can be taken in reclaim the
> allocation here is done before the inode is added to the inode cache.
>
> The patch below should help avoiding the warning:
>
>
> Index: xfs/fs/xfs/xfs_iget.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_iget.c	2009-02-24 20:56:00.716027739 +0100
> +++ xfs/fs/xfs/xfs_iget.c	2009-02-24 20:56:46.089031360 +0100
> @@ -246,9 +246,6 @@ xfs_iget_cache_miss(
> 		goto out_destroy;
>  	}
>
> -	if (lock_flags)
> -		xfs_ilock(ip, lock_flags);
> -
>  	/*
>  	 * Preload the radix tree so we can insert safely under the
>  	 * write spinlock. Note that we cannot sleep inside the preload
> @@ -259,6 +256,15 @@ xfs_iget_cache_miss(
>  		goto out_unlock;

Since we removed call to xfs_ilock() above, this should change
to 'goto out_destroy;'
Otherwise, seems goot to me.

Reviewed-by: Felix Blyakher <felixb@sgi.com>


>
> 	}
>
> +	/*
> +	 * Because the inode hasn't been added to the radix-tree yet it  
> can't
> +	 * be found by another thread, so we can do the non-sleeping lock  
> here.
> +	 */
> +	if (lock_flags) {
> +		if (!xfs_ilock_nowait(ip, lock_flags))
> +			BUG();

>
> +	}
> +
> 	mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1);
> 	first_index = agino & mask;
> 	write_lock(&pag->pag_ici_lock);
> --
> 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/


      parent reply	other threads:[~2009-03-03 16:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-20 17:52 next-20090220: XFS: inconsistent lock state Alexander Beregalov
2009-02-24 20:07 ` Christoph Hellwig
2009-03-03 16:00   ` Eric Sandeen
2009-03-03 16:57     ` Felix Blyakher
2009-03-03 17:02       ` Christoph Hellwig
2009-03-06  9:30         ` Alexander Beregalov
2009-03-03 16:45   ` Felix Blyakher [this message]

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=B793B976-694B-423B-AAF2-9A622696CC88@sgi.com \
    --to=felixb@sgi.com \
    --cc=a.beregalov@gmail.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /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;
as well as URLs for NNTP newsgroup(s).