1. 19 Dec, 2014 1 commit
    • Nicholas Bellinger's avatar
      target: Allow AllRegistrants to re-RESERVE existing reservation · ae450e24
      Nicholas Bellinger authored
      This patch changes core_scsi3_pro_release() logic to allow an
      existing AllRegistrants type reservation to be re-reserved by
      any registered I_T nexus.
      
      This addresses a issue where AllRegistrants type RESERVE was
      receiving RESERVATION_CONFLICT status if dev_pr_res_holder did
      not match the same I_T nexus, instead of just returning GOOD
      status following spc4r34 Section 5.9.9:
      
      "If the device server receives a PERSISTENT RESERVE OUT command
       with RESERVE service action where the TYPE field and the SCOPE
       field contain the same values as the existing type and scope
       from a persistent reservation holder, it shall not make any
       change to the existing persistent reservation and shall complete
       the command with GOOD status."
      Reported-by: default avatarIlias Tsitsimpis <i.tsitsimpis@gmail.com>
      Cc: Ilias Tsitsimpis <i.tsitsimpis@gmail.com>
      Cc: Lee Duncan <lduncan@suse.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      ae450e24
  2. 18 Dec, 2014 1 commit
  3. 16 Dec, 2014 4 commits
    • Nicholas Bellinger's avatar
      iscsi-target: Fail connection on short sendmsg writes · 6bf6ca75
      Nicholas Bellinger authored
      This patch changes iscsit_do_tx_data() to fail on short writes
      when kernel_sendmsg() returns a value different than requested
      transfer length, returning -EPIPE and thus causing a connection
      reset to occur.
      
      This avoids a potential bug in the original code where a short
      write would result in kernel_sendmsg() being called again with
      the original iovec base + length.
      
      In practice this has not been an issue because iscsit_do_tx_data()
      is only used for transferring 48 byte headers + 4 byte digests,
      along with seldom used control payloads from NOPIN + TEXT_RSP +
      REJECT with less than 32k of data.
      
      So following Al's audit of iovec consumers, go ahead and fail
      the connection on short writes for now, and remove the bogus
      logic ahead of his proper upstream fix.
      Reported-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: <stable@vger.kernel.org> # v3.1+
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      6bf6ca75
    • Sagi Grimberg's avatar
      iscsi-target: nullify session in failed login sequence · a0b3b9b2
      Sagi Grimberg authored
      In case login sequence failed, make sure conn->sess is
      NULL before calling wait_conn as some transports (iser)
      may rely on that (waiting for session commands).
      Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      a0b3b9b2
    • Nicholas Bellinger's avatar
      target: Avoid dropping AllRegistrants reservation during unregister · 6c3c9baa
      Nicholas Bellinger authored
      This patch fixes an issue with AllRegistrants reservations where
      an unregister operation by the I_T nexus reservation holder would
      incorrectly drop the reservation, instead of waiting until the
      last active I_T nexus is unregistered as per SPC-4.
      
      This includes updating __core_scsi3_complete_pro_release() to reset
      dev->dev_pr_res_holder with another pr_reg for this special case,
      as well as a new 'unreg' parameter to determine when the release
      is occuring from an implicit unregister, vs. explicit RELEASE.
      
      It also adds special handling in core_scsi3_free_pr_reg_from_nacl()
      to release the left-over pr_res_holder, now that pr_reg is deleted
      from pr_reg_list within __core_scsi3_complete_pro_release().
      Reported-by: default avatarIlias Tsitsimpis <i.tsitsimpis@gmail.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      6c3c9baa
    • Nicholas Bellinger's avatar
      target: Fix R_HOLDER bit usage for AllRegistrants · d16ca7c5
      Nicholas Bellinger authored
      This patch fixes the usage of R_HOLDER bit for an All Registrants
      reservation in READ_FULL_STATUS, where only the registration who
      issued RESERVE was being reported as having an active reservation.
      
      It changes core_scsi3_pri_read_full_status() to check ahead of the
      list walk of active registrations to see if All Registrants is active,
      and if so set R_HOLDER bit and scope/type fields for all active
      registrations.
      Reported-by: default avatarIlias Tsitsimpis <i.tsitsimpis@gmail.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      d16ca7c5
  4. 13 Dec, 2014 26 commits
  5. 02 Dec, 2014 8 commits