LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



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

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


Hi,

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;
spin_unlock_irq(q->queue_lock);
call the transfer(set_up_req) function;
spin_lock_irq(q->queue_lock);
}
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)) {
add_disk_randomness(...);
end_that_request_last(set_up_req->req,0);
}
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.
 
  


Reply


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 06:22 AM
How To Block PPPOE Requests ALInux Linux - Security 2 02-04-2007 01:47 AM
Grub problem : not found or not a block device bennethos Debian 1 01-04-2005 04:54 PM
mount-problem usb harddisk: not a valid block device micha Mandriva 2 11-21-2004 11:29 AM
Problem with USB Key and creating the /dev/sda1 block device Ben2210 Slackware 5 08-04-2004 03:42 AM


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

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