]> git.baikalelectronics.ru Git - kernel.git/commit
set_task_comm: kill the pointless memset() + wmb()
authorOleg Nesterov <oleg@redhat.com>
Tue, 30 Apr 2013 22:28:19 +0000 (15:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 May 2013 00:04:07 +0000 (17:04 -0700)
commit4dcdbf460b353a3caa3f0ee7f1f393394fc5ed5b
tree6be40c0ec42f7cf8eb5d09c31e1f36cc21499720
parent654a7864cd1b0b21c7fd3ef5ecbac3f7737c64a5
set_task_comm: kill the pointless memset() + wmb()

set_task_comm() does memset() + wmb() before strlcpy().  This buys
nothing and to add to the confusion, the comment is wrong.

- We do not need memset() to be "safe from non-terminating string
  reads", the final char is always zero and we never change it.

- wmb() is paired with nothing, it cannot prevent from printing
  the mixture of the old/new data unless the reader takes the lock.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/exec.c