[PATCH] RPC: Clean up socket autodisconnect
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 22 Jun 2005 17:16:28 +0000 (17:16 +0000)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 22 Jun 2005 20:07:31 +0000 (16:07 -0400)
 Cancel autodisconnect requests inside xprt_transmit() in order to avoid
 races.
 Use more efficient del_singleshot_timer_sync()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/xprt.c

index ef941e7de8bf58925cc895201d088b3fd4a0f63a..a74a1289113e0b4847dd207a0dc7308593b147f9 100644 (file)
@@ -1240,6 +1240,8 @@ xprt_transmit(struct rpc_task *task)
                        list_add_tail(&req->rq_list, &xprt->recv);
                        spin_unlock_bh(&xprt->sock_lock);
                        xprt_reset_majortimeo(req);
+                       /* Turn off autodisconnect */
+                       del_singleshot_timer_sync(&xprt->timer);
                }
        } else if (!req->rq_bytes_sent)
                return;
@@ -1370,8 +1372,6 @@ xprt_reserve(struct rpc_task *task)
                spin_lock(&xprt->xprt_lock);
                do_xprt_reserve(task);
                spin_unlock(&xprt->xprt_lock);
-               if (task->tk_rqstp)
-                       del_timer_sync(&xprt->timer);
        }
 }