[pnfs] A Few bug fixes
Iyer, Rahul
Rahul.Iyer at netapp.com
Mon Jun 4 22:59:41 EDT 2007
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
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Allocate-a-callback-request-only-if-you-have-a-mempo.patch.txt
Url: http://linux-nfs.org/pipermail/pnfs/attachments/20070604/e9c7f73f/attachment-0005.txt
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-Avoid-creating-nfs4_client-on-every-minorversion-ite.patch.txt
Url: http://linux-nfs.org/pipermail/pnfs/attachments/20070604/e9c7f73f/attachment-0006.txt
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0003-Release-cl_lock-when-unable-to-find-renew-creds-in-n.patch.txt
Url: http://linux-nfs.org/pipermail/pnfs/attachments/20070604/e9c7f73f/attachment-0007.txt
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0004-Fix-indentation-issues.patch.txt
Url: http://linux-nfs.org/pipermail/pnfs/attachments/20070604/e9c7f73f/attachment-0008.txt
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0005-Move-the-call-to-nfs_callback_down-to-nfs4_put_clien.patch.txt
Url: http://linux-nfs.org/pipermail/pnfs/attachments/20070604/e9c7f73f/attachment-0009.txt
More information about the pNFS
mailing list