This is a note to let you know that I've just added the patch titled

    LOCKD: Clear ln->nsm_clnt only when ln->nsm_users is zero

to the 3.6-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     lockd-clear-ln-nsm_clnt-only-when-ln-nsm_users-is-zero.patch
and it can be found in the queue-3.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From e498daa81295d02f7359af313c2b7f87e1062207 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <[email protected]>
Date: Wed, 24 Oct 2012 08:53:35 -0400
Subject: LOCKD: Clear ln->nsm_clnt only when ln->nsm_users is zero

From: Trond Myklebust <[email protected]>

commit e498daa81295d02f7359af313c2b7f87e1062207 upstream.

The current code is clearing it in all cases _except_ when zero.

Reported-by: Stanislav Kinsbursky <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 fs/lockd/mon.c |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -124,18 +124,16 @@ out:
 static void nsm_client_put(struct net *net)
 {
        struct lockd_net *ln = net_generic(net, lockd_net_id);
-       struct rpc_clnt *clnt = ln->nsm_clnt;
-       int shutdown = 0;
+       struct rpc_clnt *clnt = NULL;
 
        spin_lock(&ln->nsm_clnt_lock);
-       if (ln->nsm_users) {
-               if (--ln->nsm_users)
-                       ln->nsm_clnt = NULL;
-               shutdown = !ln->nsm_users;
+       ln->nsm_users--;
+       if (ln->nsm_users == 0) {
+               clnt = ln->nsm_clnt;
+               ln->nsm_clnt = NULL;
        }
        spin_unlock(&ln->nsm_clnt_lock);
-
-       if (shutdown)
+       if (clnt != NULL)
                rpc_shutdown_client(clnt);
 }
 


Patches currently in stable-queue which might be from 
[email protected] are

queue-3.6/lockd-fix-races-in-nsm_client_get.patch
queue-3.6/sunrpc-prevent-races-in-xs_abort_connection.patch
queue-3.6/lockd-clear-ln-nsm_clnt-only-when-ln-nsm_users-is-zero.patch
queue-3.6/sunrpc-clear-the-connect-flag-when-socket-state-is-tcp_close_wait.patch
queue-3.6/sunrpc-get-rid-of-the-xs_error_report-socket-callback.patch
queue-3.6/revert-sunrpc-ensure-we-close-the-socket-on-epipe-errors-too.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to