* [PATCH] kauditd thread API fixes
@ 2006-10-01 12:30 Jeff Garzik
2006-10-01 18:01 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Garzik @ 2006-10-01 12:30 UTC (permalink / raw)
To: dwmw2; +Cc: Andrew Morton, LKML
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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] kauditd thread API fixes
2006-10-01 12:30 [PATCH] kauditd thread API fixes Jeff Garzik
@ 2006-10-01 18:01 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2006-10-01 18:01 UTC (permalink / raw)
To: Jeff Garzik; +Cc: dwmw2, LKML
On Sun, 1 Oct 2006 08:30:45 -0400
Jeff Garzik <jeff@garzik.org> wrote:
>
> 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)
I've had a basically-identical patch in -mm for a few months. Sent to viro once
or twice, nothing happened, gave up. I'll re-add it to the
maintainer-spamming-list.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-10-01 18:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-01 12:30 [PATCH] kauditd thread API fixes Jeff Garzik
2006-10-01 18:01 ` Andrew Morton
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