RE: Possible bug in scsi_lib.c:scsi_req_map_sg()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux