Jump to content
Compatible Support Forums
Sign in to follow this  
kobedf

Block driver

Recommended Posts

Hi

 

i am building a block driver.It is supposed to emulate the physical driver by using a file.Furthermore , the writing takes

place inside a kernel thread.

 

I have a vdisk_request function where i do

blkdev_dequeue_request(req);

and then put the requests in a queue

The kernel thread than takes requests from the queue and

writes the info to the file.After the writing i do

end_that_request_last(req);

 

 

When i call this function i get a

kernel BUG at drivers/ll_rw_blk.c:2167

invalid operand:0000[#1]

 

 

At line 2167 i find

BUG_ON(!list_empty(&req->queuelist));

in the __blk_put_request function.

 

 

I understand that we need to obtain a lock to do any change on the request queue.I have a lock in my disk structure

but if i try spin_unlock(&dev->lock) or spin_lock(&dev->lock)

the program just ignores the call ( which is correct behavior on a single processor system)

 

 

Any idea what the problem could be?

thanks

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×