1. 13 10月, 2008 2 次提交
    • M
      [SCSI] libiscsi: Support drivers initiating session removal · e5bd7b54
      Mike Christie 提交于
      If the driver knows when hardware is removed like with cxgb3i,
      bnx2i, qla4xxx and iser then we will want to remove the sessions/devices
      that are bound to that device before removing the host.
      
      cxgb3i and in the future bnx2i will remove the host and that will
      remove all the sessions on the hba. iser can call iscsi_kill_session
      when it gets an event that indicates that a hca is removed.
      And when qla4xxx is hooked in to the lib (it is only hooked into
      the class right now) it can call iscsi remove host like the
      partial offload card drivers.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      e5bd7b54
    • M
      [SCSI] libiscsi: fix data corruption when target has to resend data-in packets · 1d9edf02
      Mike Christie 提交于
      iscsi_tcp was updating the exp_statsn (exp_statsn acknowledges
      status and tells the target it is ok to let the resources for
      a iscsi pdu to be reused) before it got all the data for pdu read
      into OS buffers. Data corruption was occuring if something happens
      to a packet and the network layer requests a retransmit, and the
      initiator has told the target about the udpated exp_statsn ack,
      then the target may be sending data from a buffer it has reused
      for a new iscsi pdu. This fixes the problem by having the LLD
      (iscsi_tcp in this case) just handle the transferring of data, and
      has libiscsi handle the processing of status (libiscsi completion
      processing is done after LLD data transfers are complete).
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      1d9edf02
  2. 12 7月, 2008 15 次提交
  3. 19 4月, 2008 1 次提交
  4. 08 2月, 2008 1 次提交
  5. 31 1月, 2008 1 次提交
    • J
      [SCSI] remove use_sg_chaining · d3f46f39
      James Bottomley 提交于
      With the sg table code, every SCSI driver is now either chain capable
      or broken (or has sg_tablesize set so chaining is never activated), so
      there's no need to have a check in the host template.
      
      Also tidy up the code by moving the scatterlist size defines into the
      SCSI includes and permit the last entry of the scatterlist pools not
      to be a power of two.
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      d3f46f39
  6. 12 1月, 2008 13 次提交
  7. 15 11月, 2007 1 次提交
    • T
      [SCSI] iscsi_tcp: fix potential lockup with write commands · 505f76b3
      Tony Battersby 提交于
      There is a race condition in iscsi_tcp.c that may cause it to forget
      that it received a R2T from the target.  This race may cause a data-out
      command (such as a write) to lock up.  The race occurs here:
      
      static int
      iscsi_send_unsol_pdu(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask)
      {
      	struct iscsi_tcp_cmd_task *tcp_ctask = ctask->dd_data;
      	int rc;
      
      	if (tcp_ctask->xmstate & XMSTATE_UNS_HDR) {
      		BUG_ON(!ctask->unsol_count);
      		tcp_ctask->xmstate &= ~XMSTATE_UNS_HDR; <---- RACE
      		...
      
      static int
      iscsi_r2t_rsp(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask)
      {
      	...
      	tcp_ctask->xmstate |= XMSTATE_SOL_HDR_INIT; <---- RACE
      	...
      
      While iscsi_xmitworker() (called from scsi_queue_work()) is preparing to
      send unsolicited data, iscsi_tcp_data_recv() (called from
      tcp_read_sock()) interrupts it upon receipt of a R2T from the target.
      Both contexts do read-modify-write of tcp_ctask->xmstate.  Usually, gcc
      on x86 will make &= and |= atomic on UP (not guaranteed of course), but
      in this case iscsi_send_unsol_pdu() reads the value of xmstate before
      clearing the bit, which causes gcc to read xmstate into a CPU register,
      test it, clear the bit, and then store it back to memory.  If the recv
      interrupt happens during this sequence, then the XMSTATE_SOL_HDR_INIT
      bit set by the recv interrupt will be lost, and the R2T will be
      forgotten.
      
      The patch below (against 2.6.24-rc1) converts accesses of xmstate to use
      set_bit, clear_bit, and test_bit instead of |= and &=.  I have tested
      this patch and verified that it fixes the problem.  Another possible
      approach would be to hold a lock during most of the rx/tx setup and
      post-processing, and drop the lock only for the actual rx/tx.
      Signed-off-by: NTony Battersby <tonyb@cybernetics.com>
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      505f76b3
  8. 27 10月, 2007 1 次提交
  9. 24 10月, 2007 1 次提交
  10. 23 10月, 2007 1 次提交
  11. 27 7月, 2007 2 次提交
  12. 21 7月, 2007 1 次提交