From 5f88f1ea16a2fb5f125505053d1bfb7901a88c64 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Thu, 24 Aug 2006 14:47:20 -0500 Subject: [DLM] add new lockspace to list ealier When a new lockspace was being created, the recoverd thread was being started for it before the lockspace was added to the global list of lockspaces. The new thread was looking up the lockspace in the global list and sometimes not finding it due to the race with the original thread adding it to the list. We need to add the lockspace to the global list before starting the thread instead of after, and if the new thread can't find the lockspace for some reason, it should return an error. Signed-off-by: David Teigland Signed-off-by: Steven Whitehouse --- fs/dlm/recoverd.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/dlm/recoverd.c') diff --git a/fs/dlm/recoverd.c b/fs/dlm/recoverd.c index eac8e9fa67f..362e3eff4dc 100644 --- a/fs/dlm/recoverd.c +++ b/fs/dlm/recoverd.c @@ -234,6 +234,10 @@ static int dlm_recoverd(void *arg) struct dlm_ls *ls; ls = dlm_find_lockspace_local(arg); + if (!ls) { + log_print("dlm_recoverd: no lockspace %p", arg); + return -1; + } while (!kthread_should_stop()) { set_current_state(TASK_INTERRUPTIBLE); -- cgit v1.2.3-18-g5258