diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2009-05-06 16:32:54 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-05-06 17:19:36 -0400 |
commit | 89996df4b5b1a09c279f50b3fd03aa9df735f5cb (patch) | |
tree | e693b22cf595b4d1a5a33e07efc674ee4542ddc3 /fs/lockd/svc.c | |
parent | b2c0cea6b1cb210e962f07047df602875564069e (diff) |
lockd: fix list corruption on lockd restart
If lockd is signalled soon enough after restart then locks_start_grace()
will try to re-add an entry to a list and trigger a lock corruption
warning.
Thanks to Wang Chen for the problem report and diagnosis.
WARNING: at lib/list_debug.c:26 __list_add+0x27/0x5c()
...
list_add corruption. next->prev should be prev (ef8fe958), but was ef8ff128. (next=ef8ff128).
...
Pid: 23062, comm: lockd Tainted: G W 2.6.30-rc2 #3
Call Trace:
[<c042d5b5>] warn_slowpath+0x71/0xa0
[<c0422a96>] ? update_curr+0x11d/0x125
[<c044b12d>] ? trace_hardirqs_on_caller+0x18/0x150
[<c044b270>] ? trace_hardirqs_on+0xb/0xd
[<c051c61a>] ? _raw_spin_lock+0x53/0xfa
[<c051c89f>] __list_add+0x27/0x5c
[<ef8f6daa>] locks_start_grace+0x22/0x30 [lockd]
[<ef8f34da>] set_grace_period+0x39/0x53 [lockd]
[<c06b8921>] ? lock_kernel+0x1c/0x28
[<ef8f3558>] lockd+0x64/0x164 [lockd]
[<c044b12d>] ? trace_hardirqs_on_caller+0x18/0x150
[<c04227b0>] ? complete+0x34/0x3e
[<ef8f34f4>] ? lockd+0x0/0x164 [lockd]
[<ef8f34f4>] ? lockd+0x0/0x164 [lockd]
[<c043dd42>] kthread+0x45/0x6b
[<c043dcfd>] ? kthread+0x0/0x6b
[<c0403c23>] kernel_thread_helper+0x7/0x10
Reported-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: stable@kernel.org
Diffstat (limited to 'fs/lockd/svc.c')
-rw-r--r-- | fs/lockd/svc.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index abf83881f68a..1a54ae14a192 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c | |||
@@ -104,6 +104,16 @@ static void set_grace_period(void) | |||
104 | schedule_delayed_work(&grace_period_end, grace_period); | 104 | schedule_delayed_work(&grace_period_end, grace_period); |
105 | } | 105 | } |
106 | 106 | ||
107 | static void restart_grace(void) | ||
108 | { | ||
109 | if (nlmsvc_ops) { | ||
110 | cancel_delayed_work_sync(&grace_period_end); | ||
111 | locks_end_grace(&lockd_manager); | ||
112 | nlmsvc_invalidate_all(); | ||
113 | set_grace_period(); | ||
114 | } | ||
115 | } | ||
116 | |||
107 | /* | 117 | /* |
108 | * This is the lockd kernel thread | 118 | * This is the lockd kernel thread |
109 | */ | 119 | */ |
@@ -149,10 +159,7 @@ lockd(void *vrqstp) | |||
149 | 159 | ||
150 | if (signalled()) { | 160 | if (signalled()) { |
151 | flush_signals(current); | 161 | flush_signals(current); |
152 | if (nlmsvc_ops) { | 162 | restart_grace(); |
153 | nlmsvc_invalidate_all(); | ||
154 | set_grace_period(); | ||
155 | } | ||
156 | continue; | 163 | continue; |
157 | } | 164 | } |
158 | 165 | ||