[pnfs] A Few bug fixes
William A. (Andy) Adamson
andros at citi.umich.edu
Tue Jun 5 11:14:13 EDT 2007
these patches have been added to the 4.1-sessions branch, and merged into
the master branch
-->Andy
On 6/4/07, Iyer, Rahul <Rahul.Iyer at netapp.com> wrote:
>
> Hi guys,
> Here are the patches with the suggested fixes/changes incorporated.
> I have removed the first patch from this set as per our discussion. As
> Benny said, this synchronization is best done if integrated with the
> forechannel code. I'll work on that next.
>
> Summary
> -------
> fs/nfs/nfs4renewd.c | 14 +++++++-----
> fs/nfs/nfs4state.c | 2 +-
> fs/nfs/super.c | 52
> ++++++++++++++++++++++++------------------------
> net/sunrpc/xprtsock.c | 18 +++++++++++++++-
> 4 files changed, 51 insertions(+), 35 deletions(-)
>
> Patch Description
> -----------------
>
> [PATCH 1/5] Allocate a callback request only if you have a mempool
>
> This patch adds a check for xprt->bc_mempool != NULL in
> xs_tcp_read_request.
> This is for cases when you may receive a packet with the call header
> set. If
> you're not expecting callbacks on the channel (e.g NFSv4.0), the code
> will
> panic
>
> ----
> [PATCH 2/5] Avoid creating nfs4_client on every minorversion iteration.
>
> This patch creates an nfs4_client structure once and then uses it for
> the
> subsequent minorversion iterations until one is found. This is safe to
> do
> because all nfs4_create_client uses is the RPC version number. The
> version number for all minorversions is 4.
>
> As a by product, this also fixes a bug in the refcounting of the
> nfs4_client
> struct. Since nfs4_create_client is called to create the client and
> rpc_shutdown_client is called to shut it down, there is a leak in the
> cl_users
> field of the nfs4_client struct. As a result if an NFSv4.1 mount fails
> and it
> falls back to v4.0, on unmount, cl_users isn't decremented. As a result,
> the
> callback server on the client isn't killed.
>
> Unrelated, but minor; some indentation is fixed
>
> ----
> [PATCH 3/5] Release cl_lock when unable to find renew creds in
> nfs4_renew_state
>
> If renew creds could not be obtained in the NFSv4 case, the spin lock on
> clp->cl_lock wasn't dropped. This resuts in a soft lockup.
>
> ----
> [PATCH 4/5] Fix indentation issues
>
> Cleaned up some of the indentation issues in the nfs4_renew_state
> function
>
> ----
> [PATCH 5/5] Move the call to nfs_callback_down to nfs4_put_client.
>
> The callto nfs_callback_down is currently in nfs4_free_client. Move this
> to
> nfs4_put_client because this is where it "fits".
>
> Regards
> Rahul
>
>
> > -----Original Message-----
> > From: Iyer, Rahul
> > Sent: Friday, May 25, 2007 5:54 PM
> > To: pnfs at linux-nfs.org
> > Subject: [pnfs] A Few bug fixes
> >
> > Hi All,
> > Here are a few Bug fixes I have for the client. Today, I got
> > the latest tree and could mount the server. These patches
> > apply to the latest tree and do not break anything. I could
> > run connectathon on them multiple times.
> >
> > Thanks
> > Regards
> > Rahul
> >
> >
> > Summary
> > -------
> > fs/nfs/nfs4renewd.c | 1 +
> > fs/nfs/nfs4state.c | 2 +-
> > fs/nfs/super.c | 22 +++++++++++--------
> > include/linux/sunrpc/xprt.h | 3 ++
> > net/sunrpc/backchannel_rqst.c | 45
> > +++++++++++++++++++++++++++++++++++++++++
> > net/sunrpc/xprtsock.c | 9 +++++++-
> > 6 files changed, 71 insertions(+), 11 deletions(-)
> >
> > Patch Description
> > -----------------
> >
> > [PATCH 1/5] Synchronize callback request allocation with disconnection
> >
> > Currently, there is no synchronization between disconnection
> > of the callback channel and allocation of callback requests.
> > This patch ensures that:
> > 1. If the channel is being disconnected, requests are not
> > allocated 2. If requests are allocated, the channel waits for
> > the requests to be
> > deallocated before disconnecting
> >
> > ----
> > [PATCH 2/5] Allocate a callback request only if you have a mempool
> >
> > This patch adds a check for xprt->bc_mempool != NULL in
> > xs_tcp_read_request.
> > This is for cases when you may receive a packet with the call
> > header set. If you're not expecting callbacks on the channel
> > (e.g NFSv4.0), the code will panic
> >
> > ----
> > [PATCH 3/5] Avoid creating nfs4_client on every minorversion
> > iteration.
> >
> > This patch creates an nfs4_client structure once and then
> > uses it for the subsequent minorversion iterations until one is found.
> >
> > As a by product, this also fixes a bug in the refcounting of
> > the nfs4_client struct. Since nfs4_create_client is called to
> > create the client and rpc_shutdown_client is called to shut
> > it down, there is a leak in the cl_users field of the
> > nfs4_client struct. As a result if an NFSv4.1 mount fails and
> > it falls back to v4.0, on unmount, cl_users isn't
> > decremented. As a result, the callback server on the client
> > isn't killed.
> >
> > ----
> > [PATCH 4/5] Release cl_lock when unable to find renew creds
> > in nfs4_renew_state
> >
> > If renew creds could not be obtained in the NFSv4 case, the
> > spin lock on
> > clp->cl_lock wasn't dropped. This resuts in a soft lockup.
> >
> > ----
> > [PATCH 5/5] Move the call to nfs_callback_down to nfs4_put_client.
> >
> > The callto nfs_callback_down is currently in
> > nfs4_free_client. Move this to nfs4_put_client because this
> > is where it "fits".
> >
> > ----
> > _______________________________________________
> > 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://linux-nfs.org/pipermail/pnfs/attachments/20070605/d86c0c1f/attachment.htm
More information about the pNFS
mailing list