Re: SLUB: kmem_cache_destroy doesn't

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

 



On Thu, 12 Apr 2007, Neil Brown wrote:

> And 
> 
>   # cat /sys/slab/raid5-md1/aliases
>   -1
> 
> is a bit suspicious.

Yuck!

> void kmem_cache_destroy(struct kmem_cache *s)
> {
> 	down_write(&slub_lock);
> 	if (s->refcount)
> 		s->refcount--;
> 	else {
> 		list_del(&s->list);
> 		WARN_ON(kmem_cache_close(s));
> 		sysfs_slab_remove(s);
> 		kfree(s);
> 	}
> 	up_write(&slub_lock);
> }
> 
> looks a bit odd.
> I would have thought the test should be:
> 
>         if (s->refcount > 1)

Correct. Does the change fix it?
-
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