Re: oops on 2.4.13-pre5 in prune_dcache

From: Linus Torvalds (torvalds@transmeta.com)
Date: Tue Oct 30 2001 - 20:17:34 EST


On Tue, 30 Oct 2001, Alexander Viro wrote:
>
> Frankly, it looks like adding magic to struct dentry and struct inode
> might be a good idea. Both icache and dcache lists tend to be long,
> so any memory corruption is very likely to show up in the code that
> walks them.

I don't like magic numbers. They showed that somebody corrupted something,
but little else. There's nothing sane you can do except warn about magic
mismatch (and ignore it or exit early), and quite frankly, an oops dump
tends to be as useful as the warning.

We used to have magic numbers for tty's and some other things, and they
never helped anybody.

Now, doing _poisoning_ etc of dynamical memory allocation, _that_ is a
magic number use I heartily agree with (if your oops dump has pointers
that look like the poison pattern, that's a useful piece of information)

If you only want to use magic numbers for memory sanity testing, you're
better off doing things like poisoning, and checking that the poison
pattern is there when you re-allocate etc.

                Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Oct 31 2001 - 21:00:42 EST