David Chatterton wrote:
I assume the loop is further up the chain since kmem_alloc should return NULL
when asked to alloc 0. So then the problem also lies further up the chain in
checking for a 0 length before calling down, and/or not assuming we are out of
memory when xfs_buf_get_noaddr fails.
Well, I set kdb breakpoints, and we only entered xfs_buf_get_noaddr once, so I
assume it's looping inside. But I was looking for bugs on, um, another
filesystem at the time, so didn't investigate much.
I can put it on my list of spare-time bugs to look at, or just thought you guys
may be interested as well.
-Eric
p.s. ok can't help but look just a bit further...
a test module which does:
int __init test_init(void)
{
void *data;
int size = 0;
data = kmalloc(size, GFP_KERNEL);
if (data == NULL) {
printk("got NULL for alloc return\n");
return -1;
} else {
printk("allocated %d bytes at %p\n", size, data);
return 0;
}
}
yields:
allocated 0 bytes at ffff810029d88480
not NULL... nifty eh!
-Eric
|