* [PATCH] sys_ioprio_set: minor do_each_thread+break fix
@ 2006-08-20 15:09 Oleg Nesterov
2006-08-21 6:28 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2006-08-20 15:09 UTC (permalink / raw)
To: Jens Axboe; +Cc: Andrew Morton, linux-kernel
>From include/linux/sched.h:
/*
* Careful: do_each_thread/while_each_thread is a double loop so
* 'break' will not work as expected - use goto instead.
*/
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- 2.6.18-rc4/fs/ioprio.c~2_break 2006-07-16 01:53:08.000000000 +0400
+++ 2.6.18-rc4/fs/ioprio.c 2006-08-20 18:57:38.000000000 +0400
@@ -111,9 +111,9 @@ asmlinkage long sys_ioprio_set(int which
continue;
ret = set_task_ioprio(p, ioprio);
if (ret)
- break;
+ goto free_uid;
} while_each_thread(g, p);
-
+free_uid:
if (who)
free_uid(user);
break;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] sys_ioprio_set: minor do_each_thread+break fix
2006-08-20 15:09 [PATCH] sys_ioprio_set: minor do_each_thread+break fix Oleg Nesterov
@ 2006-08-21 6:28 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2006-08-21 6:28 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Andrew Morton, linux-kernel
On Sun, Aug 20 2006, Oleg Nesterov wrote:
> From include/linux/sched.h:
> /*
> * Careful: do_each_thread/while_each_thread is a double loop so
> * 'break' will not work as expected - use goto instead.
> */
>
> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
>
> --- 2.6.18-rc4/fs/ioprio.c~2_break 2006-07-16 01:53:08.000000000 +0400
> +++ 2.6.18-rc4/fs/ioprio.c 2006-08-20 18:57:38.000000000 +0400
> @@ -111,9 +111,9 @@ asmlinkage long sys_ioprio_set(int which
> continue;
> ret = set_task_ioprio(p, ioprio);
> if (ret)
> - break;
> + goto free_uid;
> } while_each_thread(g, p);
> -
> +free_uid:
> if (who)
> free_uid(user);
> break;
Good catch, applied!
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-21 6:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-20 15:09 [PATCH] sys_ioprio_set: minor do_each_thread+break fix Oleg Nesterov
2006-08-21 6:28 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox