Linux-kernel mailing list archive 1998-31,: patch for 2.1.113 fs/lockd/svc.c

# patch for 2.1.113 fs/lockd/svc.c

Bill Hawes (whawes@transmeta.com)
Sat, 01 Aug 1998 14:24:47 -0700

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Kurt Huwig: "GPF in 2.0.35 (4 times)"
- Previous message: tmuller@agora.rdrop.com: "Linux 2.1.113 SMP locking hard"

This is a multi-part message in MIME format.
--------------851498C39D1923183B7114D9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The attached patch incorporates changes for lockd/svc.c sent in by Andi
Kleen. It adds a severity level classification to the various printk
messages, and adds a limit counter to the messages that can be easily
triggered from user space, to prevent spamming the syslog.

Regards,
Bill

--------------851498C39D1923183B7114D9
Content-Type: text/plain; charset=us-ascii; name="nfs_lockd113-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="nfs_lockd113-patch"

--- linux-2.1.113/fs/lockd/svc.c.old Fri Dec 19 10:54:10 1997
+++ linux-2.1.113/fs/lockd/svc.c Sat Aug 1 08:59:30 1998
@@ -186,7 +186,8 @@
nlm_shutdown_hosts();
nlmsvc_pid = 0;
} else
- printk("lockd: new process, skipping host shutdown\n");
+ printk(KERN_DEBUG
+ "lockd: new process, skipping host shutdown\n");
wake_up(&lockd_exit);
/* Exit the RPC thread */
@@ -205,6 +206,7 @@
int
lockd_up(void)
{
+ static int warned = 0;
struct svc_serv * serv;
int error = 0;
@@ -225,27 +227,32 @@
* we should be the first user ...
*/
if (nlmsvc_users > 1)
- printk("lockd_up: no pid, %d users??\n", nlmsvc_users);
+ printk(KERN_WARNING
+ "lockd_up: no pid, %d users??\n", nlmsvc_users);
error = -ENOMEM;
serv = svc_create(&nlmsvc_program, 0, NLMSVC_XDRSIZE);
if (!serv) {
- printk("lockd_up: create service failed\n");
+ printk(KERN_WARNING "lockd_up: create service failed\n");
goto out;
}
if ((error = svc_makesock(serv, IPPROTO_UDP, 0)) < 0
|| (error = svc_makesock(serv, IPPROTO_TCP, 0)) < 0) {
- printk("lockd_up: makesock failed, error=%d\n", error);
+ if (warned++ == 0)
+ printk(KERN_WARNING
+ "lockd_up: makesock failed, error=%d\n", error);
goto destroy_and_out;
- }
+ }
+ warned = 0;
/*
* Create the kernel thread and wait for it to start.
*/
error = svc_create_thread(lockd, serv);
if (error) {
- printk("lockd_up: create thread failed, error=%d\n", error);
+ printk(KERN_WARNING
+ "lockd_up: create thread failed, error=%d\n", error);
goto destroy_and_out;
}
sleep_on(&lockd_start);
@@ -267,17 +274,21 @@
void
lockd_down(void)
{
+ static int warned = 0;
+
down(&nlmsvc_sema);
if (nlmsvc_users) {
if (--nlmsvc_users)
goto out;
} else
- printk("lockd_down: no users! pid=%d\n", nlmsvc_pid);
+ printk(KERN_WARNING "lockd_down: no users! pid=%d\n", nlmsvc_pid);
if (!nlmsvc_pid) {
- printk("lockd_down: nothing to do!\n");
+ if (warned++ == 0)
+ printk(KERN_WARNING "lockd_down: no lockd running.\n");
goto out;
}
+ warned = 0;
kill_proc(nlmsvc_pid, SIGKILL, 1);
/*
@@ -289,7 +300,8 @@
interruptible_sleep_on(&lockd_exit);
current->timeout = 0;
if (nlmsvc_pid) {
- printk("lockd_down: lockd failed to exit, clearing pid\n");
+ printk(KERN_WARNING
+ "lockd_down: lockd failed to exit, clearing pid\n");
nlmsvc_pid = 0;
}
spin_lock_irq(&current->sigmask_lock);

--------------851498C39D1923183B7114D9--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

- Next message: Kurt Huwig: "GPF in 2.0.35 (4 times)"
- Previous message: tmuller@agora.rdrop.com: "Linux 2.1.113 SMP locking hard"