lkml.org 
[lkml]   [2004]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] sunrpc: replace sleep_on_timeout()
From
Date
on den 20.10.2004 Klokka 21:21 (+0200) skreiv Thomas Gleixner:
> Use wait_event_timeout() instead of the obsolete sleep_on_timeout()
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Acked-by: Ingo Molnar <mingo@elte.hu>
> ---
>
> 2.6.9-bk-041020-thomas/net/sunrpc/clnt.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletion(-)
>
> diff -puN net/sunrpc/clnt.c~sunrpc net/sunrpc/clnt.c
> --- 2.6.9-bk-041020/net/sunrpc/clnt.c~sunrpc 2004-10-20
> 15:56:37.000000000 +0200
> +++ 2.6.9-bk-041020-thomas/net/sunrpc/clnt.c 2004-10-20
> 15:56:37.000000000 +0200
> @@ -231,7 +231,8 @@ rpc_shutdown_client(struct rpc_clnt *cln
> clnt->cl_oneshot = 0;
> clnt->cl_dead = 0;
> rpc_killall_tasks(clnt);
> - sleep_on_timeout(&destroy_wait, 1*HZ);
> + wait_event_timeout(destroy_wait,
> + atomic_read(&clnt->cl_users) > 0, 1*HZ);
> }
>

No. The above is incorrect, and has the potential for a pretty
catastrophic hang due to the enclosing loop. Please replace with

wait_event_timeout(destroy_wait, atomic_read(&clnt->cl_users) == 0,
1*HZ);

Trond

--
Trond Myklebust <trond.myklebust@fys.uio.no>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:1.038 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site