Re: [PATCH] Free the temporary vfsmount created inbdev_cache_init()

From: Al Viro
Date: Wed Apr 01 2009 - 07:50:13 EST


On Wed, Apr 01, 2009 at 12:07:37PM +0100, Catalin Marinas wrote:
> The vfsmount structure allocated in this function (the bd_mnt local
> variable) is only used to obtain the blockdev_superblock and there are
> no other references to it. This structure can be safely freed (and
> prevent kmemleak from reporting it).

NAK. This kind of kludges is simply not worth doing. Store the
pointer to vfsmount into a static-in-file variable if you want
to get kmemleak to STFU.

Savings on a vfsmount are not worth neurons needed to remember that
in this particular case we are OK to do something that is utterly
wrong in general (free_vfsmnt() is a very low-level stuff that shouldn't
be used outside of namespace.c and super.c).
--
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/