lkml.org 
[lkml]   [2003]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] race on rpc code
Hi!

The following patch fixes a race on the rpc code, it is the
same race that was reported some weeks ago:
http://marc.theaimsgroup.com/?l=linux-kernel&m=104462124226133&w=2

After some minutes doing transfer of multiple files in parallel, it Oopses
at xprt_timer because task->tk_client is NULL. It can happens because
rpc_del_timer don't call timer_del_sync if the timer is running. But
if xprt_timer is running, it can can setup itself to run again, even if
the task is already being released by rpc_release_task.

--
Eduardo

diff -Nru a/net/sunrpc/sched.c b/net/sunrpc/sched.c
--- a/net/sunrpc/sched.c Mon Mar 17 20:19:20 2003
+++ b/net/sunrpc/sched.c Mon Mar 17 20:19:20 2003
@@ -169,10 +169,8 @@
static inline void
rpc_delete_timer(struct rpc_task *task)
{
- if (timer_pending(&task->tk_timer)) {
- dprintk("RPC: %4d deleting timer\n", task->tk_pid);
- del_timer_sync(&task->tk_timer);
- }
+ dprintk("RPC: %4d deleting timer\n", task->tk_pid);
+ del_timer_sync(&task->tk_timer);
}

/*[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.059 / U:1.224 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site