All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux NFS ML <linux-nfs@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: 2.6.31-rc3 nfsv4 client regression (oops)
Date: Tue, 21 Jul 2009 19:08:38 -0400	[thread overview]
Message-ID: <4A664A76.5000902@garzik.org> (raw)
In-Reply-To: <1247571788.19099.32.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>

Trond Myklebust wrote:
> NFSv4: Fix an Oops in nfs4_free_lock_state
> 
> The oops http://www.kerneloops.org/raw.php?rawid=537858&msgid= appears to
> be due to the nfs4_lock_state->ls_state field being uninitialised. This
> happens if the call to nfs4_free_lock_state() is triggered at the end of
> nfs4_get_lock_state().
> 
> The fixe is to move the initialisation of ls_state into the allocator.
> 
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> ---
> 
>  fs/nfs/nfs4state.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> 
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index b73c5a7..65ca8c1 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -553,6 +553,7 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f
>  	INIT_LIST_HEAD(&lsp->ls_sequence.list);
>  	lsp->ls_seqid.sequence = &lsp->ls_sequence;
>  	atomic_set(&lsp->ls_count, 1);
> +	lsp->ls_state = state;
>  	lsp->ls_owner = fl_owner;
>  	spin_lock(&clp->cl_lock);
>  	nfs_alloc_unique_id(&clp->cl_lockowner_id, &lsp->ls_id, 1, 64);
> @@ -587,7 +588,6 @@ static struct nfs4_lock_state *nfs4_get_lock_state(struct nfs4_state *state, fl_
>  		if (lsp != NULL)
>  			break;
>  		if (new != NULL) {
> -			new->ls_state = state;
>  			list_add(&new->ls_locks, &state->lock_states);
>  			set_bit(LK_STATE_IN_USE, &state->flags);

Ping?  This is headed upstream, right?

This oops fix has lived outside the tree for at least a week now, and 
IMO needs to move upstream...

	Jeff




WARNING: multiple messages have this Message-ID (diff)
From: Jeff Garzik <jeff@garzik.org>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux NFS ML <linux-nfs@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: 2.6.31-rc3 nfsv4 client regression (oops)
Date: Tue, 21 Jul 2009 19:08:38 -0400	[thread overview]
Message-ID: <4A664A76.5000902@garzik.org> (raw)
In-Reply-To: <1247571788.19099.32.camel@heimdal.trondhjem.org>

Trond Myklebust wrote:
> NFSv4: Fix an Oops in nfs4_free_lock_state
> 
> The oops http://www.kerneloops.org/raw.php?rawid=537858&msgid= appears to
> be due to the nfs4_lock_state->ls_state field being uninitialised. This
> happens if the call to nfs4_free_lock_state() is triggered at the end of
> nfs4_get_lock_state().
> 
> The fixe is to move the initialisation of ls_state into the allocator.
> 
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> ---
> 
>  fs/nfs/nfs4state.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> 
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index b73c5a7..65ca8c1 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -553,6 +553,7 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f
>  	INIT_LIST_HEAD(&lsp->ls_sequence.list);
>  	lsp->ls_seqid.sequence = &lsp->ls_sequence;
>  	atomic_set(&lsp->ls_count, 1);
> +	lsp->ls_state = state;
>  	lsp->ls_owner = fl_owner;
>  	spin_lock(&clp->cl_lock);
>  	nfs_alloc_unique_id(&clp->cl_lockowner_id, &lsp->ls_id, 1, 64);
> @@ -587,7 +588,6 @@ static struct nfs4_lock_state *nfs4_get_lock_state(struct nfs4_state *state, fl_
>  		if (lsp != NULL)
>  			break;
>  		if (new != NULL) {
> -			new->ls_state = state;
>  			list_add(&new->ls_locks, &state->lock_states);
>  			set_bit(LK_STATE_IN_USE, &state->flags);

Ping?  This is headed upstream, right?

This oops fix has lived outside the tree for at least a week now, and 
IMO needs to move upstream...

	Jeff




  parent reply	other threads:[~2009-07-21 23:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-14  7:48 2.6.31-rc3 nfsv4 client regression (oops) Jeff Garzik
2009-07-14 11:43 ` Trond Myklebust
     [not found]   ` <1247571788.19099.32.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-07-15  1:19     ` Jeff Garzik
2009-07-15  1:19       ` Jeff Garzik
2009-07-21 23:08     ` Jeff Garzik [this message]
2009-07-21 23:08       ` Jeff Garzik

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=4A664A76.5000902@garzik.org \
    --to=jeff@garzik.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=torvalds@linux-foundation.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 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.