]> git.karo-electronics.de Git - karo-tx-linux.git/commit
set_task_comm: kill the pointless memset() + wmb()
authorOleg Nesterov <oleg@redhat.com>
Wed, 20 Mar 2013 04:08:32 +0000 (15:08 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Mar 2013 05:34:29 +0000 (16:34 +1100)
commit2dda0636bdb72150723c3845e6aa658cbd06609d
tree53b8fe68271b30b56da96803dc4179e00b5adc1a
parente5ab6feed89aa1721b8577714ef16c68d1e668b7
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>
fs/exec.c