Block driver
This is a discussion about Block driver in the Everything Linux category; 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 qu ...
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
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
Participate in our website and join the conversation
This subject has been archived. New comments and votes cannot be submitted.