James, How about the following: 1. Cmd= Scsi_get_command( on physical device ) 2. Clone the scsi_cmnd fields of the virtual cmnd( command received by failover driver) to physical cmnd (the command allocated by scsi_get_command ) 3. blk_get_request() 4. fill the request fields, req->special = Cmd ( point the special field to allocated scsi_cmnd ) 5. set the request flags to REQ_DONTPREP 6. blk_execute_req_nowait() 7. once the command comes back call the blk_put_request() Sudhir -----Original Message----- From: James Bottomley [mailto:James.Bottomley@xxxxxxxxxxxx] Sent: Sunday, March 04, 2007 12:14 PM To: Dachepalli, Sudhir Cc: Mike Christie; Benny Halevy; Jens Axboe; Boaz Harrosh; linux-scsi@xxxxxxxxxxxxxxx Subject: RE: Possible bug in scsi_lib.c:scsi_req_map_sg() On Sun, 2007-03-04 at 11:00 -0700, Dachepalli, Sudhir wrote: > Do you think the following could work If I used blk layer functions > instead of "scsi_execute_async": > > Blk_get_request() > Req->flags |= REQ_DONTPREP There's additional complexity here: if the request isn't prepared, no command is allocated. You can't use the one you have because it belongs to a different device (plus it would be freed by this request in the completion path). > Blk_rq_map_kern() > Blk_execute_req_nowait() If the request is already mapped, you don't want to be mapping it again. > Blk_put_request() Without seeing the code it's hard to say definitively whether all this is correct. James - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html