Re: PROBLEM: kmem_cache_create: duplicate cache fat_cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Manfred Spraul <[email protected]> writes:

> OGAWA Hirofumi wrote:
>
>>Ummm... why is this normal situation? Didn't you run the
>>modules_install after changed .config?  Anyway, this patch returns
>>NULL instead of calling BUG().  This case seems to also happen with
>>user error.
>>
> Either return NULL or ignore the collision. I don't know what's the
> better solution.
>
> I'm open to either approach - it depends on what the
> kmem_cache_create() caller expects.

> --- 2.6/mm/slab.c	2005-06-05 17:29:01.000000000 +0200
> +++ build-2.6/mm/slab.c	2005-06-06 21:34:38.000000000 +0200
> @@ -1480,9 +1480,14 @@
>  			} 	
>  			if (!strcmp(pc->name,name)) { 
>  				printk("kmem_cache_create: duplicate cache %s\n",name); 
> -				up(&cache_chain_sem); 
> -				unlock_cpu_hotplug();
> -				BUG(); 
> +				/* This is a severe bug, because it breaks
> +				 * tuning by writing to /proc/slabinfo.
> +				 * But everything else works, and since
> +				 * duplicate caches typically happen if
> +				 * someone inserts a module twice, we'll
> +				 * continue.
> +				 */
> +				WARN_ON(1); 
>  			}	
>  		}
>  		set_fs(old_fs);

Ah, I see. I think this is friendly to developers and probably more
proper than my patch for this problem.

Thanks.
-- 
OGAWA Hirofumi <[email protected]>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux