lkml.org 
[lkml]   [2006]   [Aug]   [1]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 2 Aug 2006 03:00:03 +0400
FromAlexey Dobriyan <>
SubjectRe: single bit flip detector.
On Tue, Aug 01, 2006 at 06:36:22PM -0400, Dave Jones wrote:
> 000: 6b 6b 6b 6b 6a 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b

> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -1638,10 +1638,29 @@ static void poison_obj(struct kmem_cache
>  static void dump_line(char *data, int offset, int limit)
>  {
>  	int i;
> +	unsigned char total=0, bad_count=0;

	" = 0"

>  	printk(KERN_ERR "%03x:", offset);
> -	for (i = 0; i < limit; i++)
> +	for (i = 0; i < limit; i++) {
> +		if (data[offset+i] != POISON_FREE) {

				" + i"

> +			total += data[offset+i];

ditto

> +			++bad_count;

How about post increment?

> +		}
>  		printk(" %02x", (unsigned char)data[offset + i]);
> +	}
>  	printk("\n");
> +
> +	if (bad_count == 1) {
> +		errors = total ^ POISON_FREE;

undeclared "errors"

> +		if ((errors && !(errors & (errors-1))) {

		   ^^^

Turn on CONFIG_DEBUG_SLAB before compiling. ;-)

-
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/

\
 
 \ /
  Last update: 2006-08-02 01:03    [from the cache]
©2003-2008