]> Pileus Git - ~andy/linux/blobdiff - fs/lockd/svc.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
[~andy/linux] / fs / lockd / svc.c
index 66b5c98c7ff5bfbb72e6ee6d183a0e5bf15146be..2169af4d54557bda54271482ac3c21d9710fdcbb 100644 (file)
@@ -72,7 +72,9 @@ static const unsigned long    nlm_timeout_min = 3;
 static const unsigned long     nlm_timeout_max = 20;
 static const int               nlm_port_min = 0, nlm_port_max = 65535;
 
+#ifdef CONFIG_SYSCTL
 static struct ctl_table_header * nlm_sysctl_table;
+#endif
 
 static unsigned long get_lockd_grace_period(void)
 {
@@ -112,7 +114,7 @@ static inline void clear_grace_period(void)
 static int
 lockd(void *vrqstp)
 {
-       int             err = 0;
+       int             err = 0, preverr = 0;
        struct svc_rqst *rqstp = vrqstp;
        unsigned long grace_period_expire;
 
@@ -172,14 +174,20 @@ lockd(void *vrqstp)
                 * recvfrom routine.
                 */
                err = svc_recv(rqstp, timeout);
-               if (err == -EAGAIN || err == -EINTR)
+               if (err == -EAGAIN || err == -EINTR) {
+                       preverr = err;
                        continue;
+               }
                if (err < 0) {
-                       printk(KERN_WARNING
-                              "lockd: terminating on error %d\n",
-                              -err);
-                       break;
+                       if (err != preverr) {
+                               printk(KERN_WARNING "%s: unexpected error "
+                                       "from svc_recv (%d)\n", __func__, err);
+                               preverr = err;
+                       }
+                       schedule_timeout_interruptible(HZ);
+                       continue;
                }
+               preverr = err;
 
                dprintk("lockd: request from %s\n",
                                svc_print_addr(rqstp, buf, sizeof(buf)));
@@ -343,6 +351,8 @@ out:
 }
 EXPORT_SYMBOL(lockd_down);
 
+#ifdef CONFIG_SYSCTL
+
 /*
  * Sysctl parameters (same as module parameters, different interface).
  */
@@ -427,6 +437,8 @@ static ctl_table nlm_sysctl_root[] = {
        { .ctl_name = 0 }
 };
 
+#endif /* CONFIG_SYSCTL */
+
 /*
  * Module (and sysfs) parameters.
  */
@@ -500,15 +512,21 @@ module_param(nsm_use_hostnames, bool, 0644);
 
 static int __init init_nlm(void)
 {
+#ifdef CONFIG_SYSCTL
        nlm_sysctl_table = register_sysctl_table(nlm_sysctl_root);
        return nlm_sysctl_table ? 0 : -ENOMEM;
+#else
+       return 0;
+#endif
 }
 
 static void __exit exit_nlm(void)
 {
        /* FIXME: delete all NLM clients */
        nlm_shutdown_hosts();
+#ifdef CONFIG_SYSCTL
        unregister_sysctl_table(nlm_sysctl_table);
+#endif
 }
 
 module_init(init_nlm);