Assistance in understanding this...?

From: Tracy Camp (
Date: Fri Feb 16 2001 - 17:43:33 EST

I'm developing a driver that performs some 'formatting' of sorts on a scsi
block device as part of the initialization process. This involves
writting a long series of non-contiguous blocks to a disk device -
something akin to:

for(i =0; i < NUM_BLOCKS; i++) {
        bh = getblk(i * offset_size);
        memcpy(bh->b_data,&somestructure,sizeof(struct somestruct));
        ll_rw_block(bh, WRITE,1);

the kernel here I should mention is stock 2.4.0

This all works fine it seems, except that after awhile the system becomes
very fragile and eventually panic's with a NULL pointer derefrence. This
presumeably occurs because of a resource shortage. Thing I'm not
understand is how doing the above even for a large value of NUM_BLOCKS
creates a resource shortage. I'm obviously missing something here....

This is typically triggered by running any external program, (ie. vi, top,
or gcc seem to work fine for this). and the only noticable thing is that
the memory allocated to buffers grows to be pretty much all memory except
for the last two megs - this seems normal? I can capture some of the
panic/dumps if anyone thinks they might be of interest.



Tracy Camp
Product Development
Miralink Corp.PDX
Portland OR

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Fri Feb 23 2001 - 21:00:14 EST