Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-15-2007, 05:12 PM   #1
LQ Newbie
Registered: Dec 2007
Posts: 1

Rep: Reputation: 0
problem with ending requests asynchronously in my block device driver


I've a block device driver which does the following,

Inside the request function I do something like this:
request(fn) {

while ((req = elv_next_request(q)) != NULL) {
....................set up the request;
call the transfer(set_up_req) function;
spin_unlock_irq (q->queue_lock);
/* allow callback to execute as it needs the lock!!! */
spin_lock_irq (q->queue_lock);

and the transfer function calls the scsi_execute_asyn(....) with the callback function doing the end request. So, the ending of the request is done like below:

callback(fn) {

spin_lock_irqsave(q->queue_lock, flags);
if (!end_that_request_first(set_up_req->req, cmpstatus,
set_up_req->req->nr_sectors)) {
spin_unlock_irqrestore(q->queue_lock, flags);

This code works fine with most of the kernel versions, but fails on some like , Linux 2.6.18-8.el5-xen

Please help me to find out where I'm going wrong?

when I say 'fails' it just hangs without any error ....I'm using dt(Data test) to write to the disk. The logs show that all the requests that have been sent for processing, have completed sucessfully. Its just that new requests never enter the request function. So, the dt writes almost half the data and then simply hangs.

Thanks in advance for an early reply.
Anil P.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Block device driver for SDcard kingraja84 Linux - Kernel 0 06-13-2007 05:22 AM
How To Block PPPOE Requests ALInux Linux - Security 2 02-04-2007 12:47 AM
Grub problem : not found or not a block device bennethos Debian 1 01-04-2005 03:54 PM
mount-problem usb harddisk: not a valid block device micha Mandriva 2 11-21-2004 10:29 AM
Problem with USB Key and creating the /dev/sda1 block device Ben2210 Slackware 5 08-04-2004 02:42 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:51 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration