Re: [PATCH] scsi: fix sense_slab/bio swapping livelock

From: Pekka Enberg
Date: Mon Apr 07 2008 - 18:44:18 EST


On Tue, 8 Apr 2008, Pekka J Enberg wrote:
So something like the following (totally untested) patch modulo the pre-allocation bits.

Linus Torvalds wrote:
Hmm. I didn't check, but won't this cause problems on the freeing path when we call kmem_cache_free() on the result but with the wrong "struct kmem_cache" pointer?

Aah, yes. I was thinking of kmalloc() here for which it works as expected because kfree() will return the page to the proper cache. But we can relax the rules of kmem_cache_free() a bit to make this work (but perhaps add a WARN_ON() there if cache doesn't match page->slab).

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