All of lore.kernel.org
 help / color / mirror / Atom feed
From: Santosh Shilimkar <santosh.shilimkar@ti.com>
To: "J. R. Okajima" <hooanon05@yahoo.co.jp>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>,
	Nick Piggin <npiggin@kernel.dk>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: RE: NFS root lockups with -next 20110113
Date: Thu, 13 Jan 2011 18:58:37 +0530	[thread overview]
Message-ID: <676f5c24375e1cc2aa14fe6630ef1324@mail.gmail.com> (raw)
In-Reply-To: <8138.1294924927@jrobl>

> -----Original Message-----
> From: J. R. Okajima [mailto:hooanon05@yahoo.co.jp]
> Sent: Thursday, January 13, 2011 6:52 PM
> To: Mark Brown
> Cc: Trond Myklebust; Santosh Shilimkar; Nick Piggin; linux-
> nfs@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> fsdevel@vger.kernel.org
> Subject: Re: NFS root lockups with -next 20110113
>
>
> Mark Brown:
> > With -next 20110113 I'm experiencing lockups shortly after
> userspace
> > starts when booting with my root filesystem on NFS, log below.  I
> can
> > boot into /bin/sh but running real userspace triggers this very
> easily.
> > This was introduced sometime this week.
> >
> > I've not bisected or otherwise investigated much yet, but I do
> notice
> > code added recently by Nick in "fs: rcu-walk for path lookup"
> showing up
> > in the backtrace so including him in the CCs.
>
> This and a report from Santosh Shilimkar look like the same problem
> which I reported, and I am testing this patch. If you can, please
> try it
> too.
> Note: Of course this is not offcial fix.
>

It works. My board booted with NFS with below patch


>
> diff --git a/fs/namei.c b/fs/namei.c
> index 5bb7588..51d052f 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -480,6 +480,7 @@ static int nameidata_dentry_drop_rcu(struct
> nameidata *nd, struct dentry *dentry
>  {
>  	struct fs_struct *fs = current->fs;
>  	struct dentry *parent = nd->path.dentry;
> +	int isroot;
>
>  	BUG_ON(!(nd->flags & LOOKUP_RCU));
>  	if (nd->root.mnt) {
> @@ -489,18 +490,22 @@ static int nameidata_dentry_drop_rcu(struct
> nameidata *nd, struct dentry *dentry
>  			goto err_root;
>  	}
>  	spin_lock(&parent->d_lock);
> -	spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
> -	if (!__d_rcu_to_refcount(dentry, nd->seq))
> -		goto err;
> +	isroot = IS_ROOT(dentry);
> +	if (!isroot) {
> +		spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
> +		if (!__d_rcu_to_refcount(dentry, nd->seq))
> +			goto err;
> +	}
>  	/*
>  	 * If the sequence check on the child dentry passed, then the
> child has
>  	 * not been removed from its parent. This means the parent
> dentry must
>  	 * be valid and able to take a reference at this point.
>  	 */
> -	BUG_ON(!IS_ROOT(dentry) && dentry->d_parent != parent);
> +	BUG_ON(!isroot && dentry->d_parent != parent);
>  	BUG_ON(!parent->d_count);
>  	parent->d_count++;
> -	spin_unlock(&dentry->d_lock);
> +	if (!isroot)
> +		spin_unlock(&dentry->d_lock);
>  	spin_unlock(&parent->d_lock);
>  	if (nd->root.mnt) {
>  		path_get(&nd->root);
> @@ -513,7 +518,8 @@ static int nameidata_dentry_drop_rcu(struct
> nameidata *nd, struct dentry *dentry
>  	nd->flags &= ~LOOKUP_RCU;
>  	return 0;
>  err:
> -	spin_unlock(&dentry->d_lock);
> +	if (!isroot)
> +		spin_unlock(&dentry->d_lock);
>  	spin_unlock(&parent->d_lock);
>  err_root:
>  	if (nd->root.mnt)

WARNING: multiple messages have this Message-ID (diff)
From: Santosh Shilimkar <santosh.shilimkar-l0cyMroinI0@public.gmane.org>
To: "J. R. Okajima"
	<hooanon05-/E1597aS9LR3+QwDJ9on6Q@public.gmane.org>,
	Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Cc: Trond Myklebust
	<Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>,
	Nick Piggin <npiggin-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: RE: NFS root lockups with -next 20110113
Date: Thu, 13 Jan 2011 18:58:37 +0530	[thread overview]
Message-ID: <676f5c24375e1cc2aa14fe6630ef1324@mail.gmail.com> (raw)
In-Reply-To: <8138.1294924927@jrobl>

> -----Original Message-----
> From: J. R. Okajima [mailto:hooanon05-/E1597aS9LR3+QwDJ9on6Q@public.gmane.org]
> Sent: Thursday, January 13, 2011 6:52 PM
> To: Mark Brown
> Cc: Trond Myklebust; Santosh Shilimkar; Nick Piggin; linux-
> nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-
> fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: Re: NFS root lockups with -next 20110113
>
>
> Mark Brown:
> > With -next 20110113 I'm experiencing lockups shortly after
> userspace
> > starts when booting with my root filesystem on NFS, log below.  I
> can
> > boot into /bin/sh but running real userspace triggers this very
> easily.
> > This was introduced sometime this week.
> >
> > I've not bisected or otherwise investigated much yet, but I do
> notice
> > code added recently by Nick in "fs: rcu-walk for path lookup"
> showing up
> > in the backtrace so including him in the CCs.
>
> This and a report from Santosh Shilimkar look like the same problem
> which I reported, and I am testing this patch. If you can, please
> try it
> too.
> Note: Of course this is not offcial fix.
>

It works. My board booted with NFS with below patch


>
> diff --git a/fs/namei.c b/fs/namei.c
> index 5bb7588..51d052f 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -480,6 +480,7 @@ static int nameidata_dentry_drop_rcu(struct
> nameidata *nd, struct dentry *dentry
>  {
>  	struct fs_struct *fs = current->fs;
>  	struct dentry *parent = nd->path.dentry;
> +	int isroot;
>
>  	BUG_ON(!(nd->flags & LOOKUP_RCU));
>  	if (nd->root.mnt) {
> @@ -489,18 +490,22 @@ static int nameidata_dentry_drop_rcu(struct
> nameidata *nd, struct dentry *dentry
>  			goto err_root;
>  	}
>  	spin_lock(&parent->d_lock);
> -	spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
> -	if (!__d_rcu_to_refcount(dentry, nd->seq))
> -		goto err;
> +	isroot = IS_ROOT(dentry);
> +	if (!isroot) {
> +		spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
> +		if (!__d_rcu_to_refcount(dentry, nd->seq))
> +			goto err;
> +	}
>  	/*
>  	 * If the sequence check on the child dentry passed, then the
> child has
>  	 * not been removed from its parent. This means the parent
> dentry must
>  	 * be valid and able to take a reference at this point.
>  	 */
> -	BUG_ON(!IS_ROOT(dentry) && dentry->d_parent != parent);
> +	BUG_ON(!isroot && dentry->d_parent != parent);
>  	BUG_ON(!parent->d_count);
>  	parent->d_count++;
> -	spin_unlock(&dentry->d_lock);
> +	if (!isroot)
> +		spin_unlock(&dentry->d_lock);
>  	spin_unlock(&parent->d_lock);
>  	if (nd->root.mnt) {
>  		path_get(&nd->root);
> @@ -513,7 +518,8 @@ static int nameidata_dentry_drop_rcu(struct
> nameidata *nd, struct dentry *dentry
>  	nd->flags &= ~LOOKUP_RCU;
>  	return 0;
>  err:
> -	spin_unlock(&dentry->d_lock);
> +	if (!isroot)
> +		spin_unlock(&dentry->d_lock);
>  	spin_unlock(&parent->d_lock);
>  err_root:
>  	if (nd->root.mnt)
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-01-13 13:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13 12:06 NFS root lockups with -next 20110113 Mark Brown
2011-01-13 13:22 ` J. R. Okajima
2011-01-13 13:28   ` Santosh Shilimkar [this message]
2011-01-13 13:28     ` Santosh Shilimkar
2011-01-13 13:45     ` J. R. Okajima
2011-01-13 13:45       ` J. R. Okajima
2011-01-14  3:59       ` Nick Piggin
2011-01-14  3:59         ` Nick Piggin
2011-01-14  4:41         ` J. R. Okajima
2011-01-14  4:41           ` J. R. Okajima
2011-01-19  6:43         ` vfs-scale, general questions (Re: NFS root lockups with -next 20110113) J. R. Okajima
2011-01-19  6:43           ` J. R. Okajima
2011-01-19  7:21           ` Nick Piggin
2011-01-19  7:21             ` Nick Piggin
2011-01-20  9:05             ` vfs-scale, general questions J. R. Okajima
2011-01-20 11:15               ` Miklos Szeredi
2011-01-21  6:38                 ` J. R. Okajima
2011-02-11  3:49           ` vfs-scale, general questions (Re: NFS root lockups with -next 20110113) Ian Kent
2011-02-11  3:49             ` Ian Kent
2011-02-13  2:19             ` J. R. Okajima
2011-01-13 13:35   ` NFS root lockups with -next 20110113 Mark Brown
2011-01-13 13:35     ` Mark Brown
2011-01-13 13:35     ` Mark Brown
2011-01-13 13:41   ` Santosh Shilimkar
2011-01-13 13:41     ` Santosh Shilimkar
2011-01-13 13:41     ` Santosh Shilimkar
2011-01-13 13:41     ` Santosh Shilimkar

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=676f5c24375e1cc2aa14fe6630ef1324@mail.gmail.com \
    --to=santosh.shilimkar@ti.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=hooanon05@yahoo.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=npiggin@kernel.dk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.