]> git.baikalelectronics.ru Git - kernel.git/commit
sched/core: Remove 'task' parameter and rename tsk_restore_flags() to current_restore...
authorNeilBrown <neilb@suse.com>
Fri, 7 Apr 2017 00:03:26 +0000 (10:03 +1000)
committerIngo Molnar <mingo@kernel.org>
Tue, 11 Apr 2017 07:06:32 +0000 (09:06 +0200)
commit8c0b6c2e04783e363def3bc72ced5d5114dd3e4a
tree9a7c56b8c2daac8ea7c0f39f58e4c5aa84615ad3
parente251a6698075af0118d26df8a52da2f7e380aac3
sched/core: Remove 'task' parameter and rename tsk_restore_flags() to current_restore_flags()

It is not safe for one thread to modify the ->flags
of another thread as there is no locking that can protect
the update.

So tsk_restore_flags(), which takes a task pointer and modifies
the flags, is an invitation to do the wrong thing.

All current users pass "current" as the task, so no developers have
accepted that invitation.  It would be best to ensure it remains
that way.

So rename tsk_restore_flags() to current_restore_flags() and don't
pass in a task_struct pointer.  Always operate on current->flags.

Signed-off-by: NeilBrown <neilb@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/block/nbd.c
drivers/scsi/iscsi_tcp.c
fs/nfsd/vfs.c
include/linux/sched.h
kernel/softirq.c
net/core/dev.c
net/core/sock.c