Messages in this thread | | | Date | Fri, 24 May 2013 12:53:23 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH 5/6] coredump: kill call_count, add core_name_size |
| |
On Wed, 15 May 2013 22:12:32 +0200 Oleg Nesterov <oleg@redhat.com> wrote:
> Imho, "atomic_t call_count" is ugly and should die. It buys > nothing and in fact it can grow more than necessary, expand > doesn't check if it was already incremented by another task. > > Kill it, and introduce "static int core_name_size" updated by > expand_corename(). This is obviously racy too but harmless, > and core_name_size never grows for no reason. > > We do not bother to to calculate the "right" new size, we > simply do kmalloc(size_we_need) and use ksize() to rely on > kmalloc_index's decision. > > Finally change format_corename() to use expand_corename(), > krealloc(NULL) is fine.
The code still looks like a bunch of fluff. I look at it and think "wtf, why doesn't it just use kasprintf()".
If there were any comments in there at all which explained the reason for the code's existence, perhaps I wouldn't think that. But there aren't, so I do.
| |