lkml.org 
[lkml]   [2006]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kernel BUG at fs/locks.c:1932!
On Sun, Feb 19, 2006 at 01:27:55PM -0500, Trond Myklebust wrote:
> On Fri, 2006-02-17 at 16:15 +0100, Fermin Molina wrote:
> > Hi,
> >
> > I run samba sharing NFS mounted shares from another machine. I'm getting
> > the following bugs in console (and in logs), when I stop samba (but not
> > always, I think it depends of stalled locks):
> >
> > lockd: unexpected unlock status: 7
> > lockd: unexpected unlock status: 7
> > lockd: unexpected unlock status: 7
> > ------------[ cut here ]------------
>
> Hmm... The problem here is that the server is returning an unexpected
> error: it is normally supposed to return "lock granted" or "grace
> error", but is actually returning "stale filehandle".
>
> Anyhow, the client should be able to deal with this without Oopsing.


This seems to be a patch that should go into 2.6.16?


> The attached patch ought to fix that. Please could you give it a try?
>
> Cheers,
> Trond

> Author: Trond Myklebust <Trond.Myklebust@netapp.com>
> NLM: Ensure we do not Oops in the case of an unlock
>
> In theory, NLM specs assure us that the server will only reply LCK_GRANTED
> or LCK_DENIED_GRACE_PERIOD to our NLM_UNLOCK request.
>
> In practice, we should not assume this to be the case, and the code will
> currently Oops if we do.
>
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> ---
>
> fs/lockd/clntproc.c | 8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
> index 7e89655..da76592 100644
> --- a/fs/lockd/clntproc.c
> +++ b/fs/lockd/clntproc.c
> @@ -644,10 +644,16 @@ nlmclnt_unlock(struct nlm_rqst *req, str
>
> status = nlmclnt_call(req, NLMPROC_UNLOCK);
> nlmclnt_release_lockargs(req);
> + /*
> + * Note: the server is supposed to either grant us the unlock
> + * request, or to deny it with NLM_LCK_DENIED_GRACE_PERIOD. In either
> + * case, we want to unlock.
> + */
> + do_vfs_lock(fl);
> +
> if (status < 0)
> return status;
>
> - do_vfs_lock(fl);
> if (resp->status == NLM_LCK_GRANTED)
> return 0;
>


cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

-
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/

\
 
 \ /
  Last update: 2006-02-25 16:37    [W:0.062 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site