lockd: fix list corruption on lockd restart
[pandora-kernel.git] / fs / lockd / svc.c
index abf8388..1a54ae1 100644 (file)
@@ -104,6 +104,16 @@ static void set_grace_period(void)
        schedule_delayed_work(&grace_period_end, grace_period);
 }
 
+static void restart_grace(void)
+{
+       if (nlmsvc_ops) {
+               cancel_delayed_work_sync(&grace_period_end);
+               locks_end_grace(&lockd_manager);
+               nlmsvc_invalidate_all();
+               set_grace_period();
+       }
+}
+
 /*
  * This is the lockd kernel thread
  */
@@ -149,10 +159,7 @@ lockd(void *vrqstp)
 
                if (signalled()) {
                        flush_signals(current);
-                       if (nlmsvc_ops) {
-                               nlmsvc_invalidate_all();
-                               set_grace_period();
-                       }
+                       restart_grace();
                        continue;
                }