From: Jeff Garzik <jeff@garzik.org>
To: dwmw2@infradead.org
Cc: Andrew Morton <akpm@osdl.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] kauditd thread API fixes
Date: Sun, 1 Oct 2006 08:30:45 -0400 [thread overview]
Message-ID: <20061001123045.GA29682@havoc.gtf.org> (raw)
Kill the "function should return a value" warning, and use the standard
mechanism for deciding when a thread should stop.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
---
Given the security-sensitive nature of the audit function, _perhaps_ the
omission of kthread_should_stop() was intentional. If so, it at least
deserves a comment. But I think this is more correct.
diff --git a/kernel/audit.c b/kernel/audit.c
index f9889ee..b9146b1 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -340,7 +340,7 @@ static int kauditd_thread(void *dummy)
{
struct sk_buff *skb;
- while (1) {
+ do {
skb = skb_dequeue(&audit_skb_queue);
wake_up(&audit_backlog_wait);
if (skb) {
@@ -368,7 +368,9 @@ static int kauditd_thread(void *dummy)
__set_current_state(TASK_RUNNING);
remove_wait_queue(&kauditd_wait, &wait);
}
- }
+ } while (!kthread_should_stop());
+
+ return 0;
}
int audit_send_list(void *_dest)
next reply other threads:[~2006-10-01 12:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-01 12:30 Jeff Garzik [this message]
2006-10-01 18:01 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061001123045.GA29682@havoc.gtf.org \
--to=jeff@garzik.org \
--cc=akpm@osdl.org \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome