1. 07 4月, 2014 21 次提交
  2. 14 3月, 2014 3 次提交
  3. 07 3月, 2014 1 次提交
    • S
      Target/sbc: Fix sbc_copy_prot for offset scatters · 16c0ae02
      Sagi Grimberg 提交于
      When copying between device and command protection scatters
      we must take into account that device scatters might be offset
      and we might copy outside scatter range. Thus for each cmd prot
      scatter we must take the min between cmd prot scatter, dev prot
      scatter, and whats left (and loop in case we havn't copied enough
      from/to cmd prot scatter).
      
      Example (single t_prot_sg of len 2048):
      kernel: sbc_dif_copy_prot: se_cmd=ffff880380aaf970, left=2048, len=2048, dev_prot_sg_offset=3072, dev_prot_sg_len=4096
      kernel: isert: se_cmd=ffff880380aaf970 PI error found type 0 at sector 0x2600 expected 0x0 vs actual 0x725f, lba=2580
      
      Instead of copying 2048 from offset 3072 (copying junk outside sg
      limit 4096), we must to copy 1024 and continue to next sg until
      we complete cmd prot scatter.
      
      This issue was found using iSER T10-PI offload over rd_mcp (wasn't
      discovered with fileio since file_dev prot sglists are never offset).
      
      Changes from v1:
      - Fix sbc_copy_prot copy length miss-calculation
      
      Changes from v0:
      - Removed psg->offset consideration for psg_len computation
      - Removed sg->offset consideration for offset condition
      - Added copied consideraiton for len computation
      - Added copied offset to paddr when doing memcpy
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      16c0ae02
  4. 05 3月, 2014 3 次提交
    • N
      iscsi/iser-target: Fix isert_conn->state hung shutdown issues · defd8848
      Nicholas Bellinger 提交于
      This patch addresses a couple of different hug shutdown issues
      related to wait_event() + isert_conn->state.  First, it changes
      isert_conn->conn_wait + isert_conn->conn_wait_comp_err from
      waitqueues to completions, and sets ISER_CONN_TERMINATING from
      within isert_disconnect_work().
      
      Second, it splits isert_free_conn() into isert_wait_conn() that
      is called earlier in iscsit_close_connection() to ensure that
      all outstanding commands have completed before continuing.
      
      Finally, it breaks isert_cq_comp_err() into seperate TX / RX
      related code, and adds logic in isert_cq_rx_comp_err() to wait
      for outstanding commands to complete before setting ISER_CONN_DOWN
      and calling complete(&isert_conn->conn_wait_comp_err).
      Acked-by: NSagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: <stable@vger.kernel.org> #3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      defd8848
    • N
      iscsi/iser-target: Use list_del_init for ->i_conn_node · 5159d763
      Nicholas Bellinger 提交于
      There are a handful of uses of list_empty() for cmd->i_conn_node
      within iser-target code that expect to return false once a cmd
      has been removed from the per connect list.
      
      This patch changes all uses of list_del -> list_del_init in order
      to ensure that list_empty() returns false as expected.
      Acked-by: NSagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: <stable@vger.kernel.org> #3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5159d763
    • N
      iscsi-target: Fix iscsit_get_tpg_from_np tpg_state bug · a2a99cea
      Nicholas Bellinger 提交于
      This patch fixes a bug in iscsit_get_tpg_from_np() where the
      tpg->tpg_state sanity check was looking for TPG_STATE_FREE,
      instead of != TPG_STATE_ACTIVE.
      
      The latter is expected during a normal TPG shutdown once the
      tpg_state goes into TPG_STATE_INACTIVE in order to reject any
      new incoming login attempts.
      
      Cc: <stable@vger.kernel.org> #3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      a2a99cea
  5. 24 2月, 2014 3 次提交
  6. 13 2月, 2014 6 次提交
  7. 30 1月, 2014 2 次提交
    • N
      target: Fix percpu_ref_put race in transport_lun_remove_cmd · 5259a06e
      Nicholas Bellinger 提交于
      This patch fixes a percpu_ref_put race for se_lun->lun_ref in
      transport_lun_remove_cmd() where ->lun_ref could end up being
      put more than once per command via different target completion
      and fabric release contexts.
      
      It adds a cmpxchg() for se_cmd->lun_ref_active to ensure that
      percpu_ref_put() is only ever called once per se_cmd.
      
      This bug was manifesting itself as a LUN shutdown regression
      bug in >= v3.13 code, where percpu_ref_kill() would end up
      hanging indefinately due to the incorrect percpu_ref count.
      
      (Change se_cmd->lun_ref_active from bool -> int to force at
       least a 4-byte cmpxchg with MIPS ll/sc ins. - Fengguang)
      Reported-by: NTommy Apel <tommyapeldk@gmail.com>
      Cc: Tommy Apel <tommyapeldk@gmail.com>
      Cc: <stable@vger.kernel.org> #3.13+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5259a06e
    • A
      target/iscsi: Fix network portal creation race · ee291e63
      Andy Grover 提交于
      When creating network portals rapidly, such as when restoring a
      configuration, LIO's code to reuse existing portals can return a false
      negative if the thread hasn't run yet and set np_thread_state to
      ISCSI_NP_THREAD_ACTIVE. This causes an error in the network stack
      when attempting to bind to the same address/port.
      
      This patch sets NP_THREAD_ACTIVE before the np is placed on g_np_list,
      so even if the thread hasn't run yet, iscsit_get_np will return the
      existing np.
      
      Also, convert np_lock -> np_mutex + hold across adding new net portal
      to g_np_list to prevent a race where two threads may attempt to create
      the same network portal, resulting in one of them failing.
      
      (nab: Add missing mutex_unlocks in iscsit_add_np failure paths)
      (DanC: Fix incorrect spin_unlock -> spin_unlock_bh)
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Cc: <stable@vger.kernel.org> #3.1+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      ee291e63
  8. 25 1月, 2014 1 次提交