[pnfs] [PATCH] wrong hold count on clr_ref
Marc Eshel
eshel at almaden.ibm.com
Mon Jun 4 20:44:15 EDT 2007
Benny Halevy <bhalevy at panasas.com> wrote on 06/04/2007 05:28:47 PM:
> Marc Eshel wrote:
> > The first change is needed since know we have a compound rpc with 2
ops.
> > Problem 6 still needs be fixed and until we do comment the BUG_ON so
we
> > can see the layout return working.
> >
> > 6. The serve is not waiting for the client to return the layout before
> > calling destroy_layoutrecall() it because the hold count clr_ref is
not
> > set correctly. This problem is not fixed except for removing the BUG
that
> > causes the crash.
>
> The BUG_ON causes the crash on purpose and it's right,
> removing it just invites trouble down the road.
> Can you please try adding a kref_get(&clr->clr_ref)
> in hash_layoutrecall instead? This was the original intent...
Yes, I know, this was a quick fix to see how far we go. I will try to see
where is the missing hold count.
Marc.
>
> >
> >> From: Marc Eshel <eshel at almaden.ibm.com>
> >>
> >>
> >> ---
> >>
> >> fs/nfsd/nfs4callback.c | 2 +-
> >> fs/nfsd/nfs4state.c | 2 +-
> >> 2 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> >> index b7bc5c3..da20278 100644
> >> --- a/fs/nfsd/nfs4callback.c
> >> +++ b/fs/nfsd/nfs4callback.c
> >> @@ -413,7 +413,7 @@ nfs41_xdr_enc_cb_layout(struct rpc_rqst
> >> struct nfs4_layoutrecall *args = rpc_args->args_op;
> >> struct nfs4_cb_compound_hdr hdr = {
> >> .ident = 0,
> >> - .nops = 1,
> >> + .nops = 2,
> >> };
> >>
> >> xdr_init_encode(&xdr, &req->rq_snd_buf, p);
> >> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> >> index 2fe5414..e48f08d 100644
> >> --- a/fs/nfsd/nfs4state.c
> >> +++ b/fs/nfsd/nfs4state.c
> >> @@ -4029,7 +4029,7 @@ destroy_layoutrecall(struct kref *kref)
> >> container_of(kref, struct nfs4_layoutrecall, clr_ref);
> >> dprintk("pNFS %s: clr %p fp %p clp %p\n", __FUNCTION__, clr,
> >> clr->clr_file, clr->clr_client);
> >> - BUG_ON(!list_empty(&clr->clr_perclnt));
> >> +//??? BUG_ON(!list_empty(&clr->clr_perclnt));
> >> if (clr->clr_file)
> >> put_nfs4_file(clr->clr_file);
> >> kmem_cache_free(pnfs_layoutrecall_slab, clr);
> >> _______________________________________________
> >> pNFS mailing list
> >> pNFS at linux-nfs.org
> >> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
> >
> > _______________________________________________
> > pNFS mailing list
> > pNFS at linux-nfs.org
> > http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
>
More information about the pNFS
mailing list