Re: 2.6.16-rc1-mm2

From: Valdis . Kletnieks
Date: Fri Jan 20 2006 - 10:18:33 EST


On Fri, 20 Jan 2006 03:40:27 PST, Andrew Morton said:
> Pekka Enberg <penberg@xxxxxxxxxxxxxx> wrote:

> > Hmm. This still leaves kstrdup() broken which is why I would prefer
> > the following patch to be applied:
>
> kstrdup() doesn't get used much.
>
> > http://marc.theaimsgroup.com/?l=linux-kernel&m=113767657400334&w=2
>
> That adds more complexity, IMO. A bit ifdeffy too. __do_kmalloc() should
> be __always_inline, methinks?

For what it's worth, I spent some time trying to get kstrdup() fixed as well,
but gave up because:

a) The leak I was chasing was using kzalloc() ;)

b) I got stuck in a .h dependency loop - the prototype for kzalloc is in
slab.h, and by that point in slab.h, we've seen a prototype for __kmalloc().
Unfortunately, kstrdup() comes out of string.h, and there's usages where
string.h has been #included but we've not seen __kmalloc(). Unfortunately,
just #include'ing what's needed didn't work, because of the way the code
uses #ifndef _LINUX_FOO_H_ - when I started looking at having to #undef stuff
to get a prototype of __kmalloc(), I gave up. ;)

Attachment: pgp00000.pgp
Description: PGP signature