Re: [PATCH 0/4] v6 Improve task->comm locking situation
From: Linus Torvalds
Date: Wed May 18 2011 - 15:58:46 EST
On Tue, May 17, 2011 at 6:41 PM, John Stultz <john.stultz@xxxxxxxxxx> wrote:
> While this was brought up at the time, it was not considered
> problematic, as the comm writing was done in such a way that
> only null or incomplete comms could be read. However, recently
> folks have made it clear they want to see this issue resolved.
I don't think a new lock (or any lock) is at all appropriate.
There's just no point. Just guarantee that the last byte is always
zero, and you're done.
If you just guarantee that, THERE IS NO RACE. The last byte never
changes. You may get odd half-way strings, but you've trivially
guaranteed that they are C NUL-terminated, with no locking, no memory
ordering, no nothing.
Anybody who asks for any locking is just being a silly git. Tell them
to man the f*ck up.
So I'm not going to apply anything like this for 2.6.39, but I'm also
not going to apply it for 40 or 41 or anything else.
I refuse to accept just stupid unnecessary crap.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/