1. 03 10月, 2012 7 次提交
    • D
      target/iscsi: precedence bug in iscsit_set_dataout_sequence_values() · d7ca663c
      Dan Carpenter 提交于
      Clang warns about this bug:
      drivers/target/iscsi/iscsi_target_erl0.c:52:45: warning: operator '?:'
      	has lower precedence than '+'; '+' will be evaluated first
      	[-Wparentheses]
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d7ca663c
    • N
      iscsi-target: Add explicit set of cache_dynamic_acls=1 for TPG demo-mode · 38b11bae
      Nicholas Bellinger 提交于
      We've had reports in the past about this specific case, so it's time to
      go ahead and explicitly set cache_dynamic_acls=1 for generate_node_acls=1
      (TPG demo-mode) operation.
      
      During normal generate_node_acls=0 operation with explicit NodeACLs ->
      se_node_acl memory is persistent to the configfs group located at
      /sys/kernel/config/target/$TARGETNAME/$TPGT/acls/$INITIATORNAME, so in
      the generate_node_acls=1 case we want the reservation logic to reference
      existing per initiator IQN se_node_acl memory (not to generate a new
      se_node_acl), so go ahead and always set cache_dynamic_acls=1 when
      TPG demo-mode is enabled.
      Reported-by: NRonnie Sahlberg <ronniesahlberg@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      38b11bae
    • N
      iscsi-target: Change iscsi_target_seq_pdu_list.c to honor MaxXmitDataSegmentLength · b094a4bd
      Nicholas Bellinger 提交于
      This patch converts iscsi_target_seq_pdu_list.c code for DataSequenceInOrder=No +
      DataPDUInOrder=No operation to honor the MaxXmitDataSegmentLength value
      for iscsi_cmd->se_cmd.data_direction == DMA_TO_DEVICE cases.
      
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      b094a4bd
    • N
      iscsi-target: Add MaxXmitDataSegmentLength connection recovery check · 1c417f39
      Nicholas Bellinger 提交于
      The iSCSI TMR TASK_REASSIGN completion logic in iscsi_tmr_task_reassign()
      does an explict check for MRDSL across task reassignment, so go ahead and
      add an explict MaxXmitDataSegmentLength check here as well to be safe.
      
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      1c417f39
    • N
      iscsi-target: Convert incoming PDU payload checks to MaxXmitDataSegmentLength · 21f5aa7e
      Nicholas Bellinger 提交于
      Now that iscsi-target supports a local configurable MaxXmitDataSegmentLength,
      go ahead and make ISCSI_OP_SCSI_CMD, ISCSI_OP_SCSI_DATA_OUT, ISCSI_OP_NOOP_OUT
      and ISCSI_OP_TEXT PDU payload checks honor conn_ops->MaxXmitDataSegmentLength.
      
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      21f5aa7e
    • N
      iscsi-target: Enable MaxXmitDataSegmentLength operation in login path · 9977bb18
      Nicholas Bellinger 提交于
      This patch activates MaxXmitDataSegmentLength usage that performs the
      following sequence of events:
      
      - Once the incoming initiator's MAXRECVDATASEGMENTLENGTH key is detected
        within iscsi_check_acceptor_state(), save the requested MRDSL into
        conn->conn_ops->MaxRecvDataSegmentLength
      
      - Next change the outgoing target's MaxRecvDataSegmenthLength key=value
        based upon the local TPG's MaxXmitDataSegmentLength attribute value.
      
      - Change iscsi_set_connection_parameters() to skip the assignment of
        conn->conn_ops->MaxRecvDataSegmentLength, now setup within
        iscsi_check_acceptor_state()
      
      Also update iscsi_decode_text_input() -> iscsi_check_acceptor_state()
      code-path to accept struct iscsi_conn *.
      
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9977bb18
    • N
      iscsi-target: Add base MaxXmitDataSegmentLength code · e004cb25
      Nicholas Bellinger 提交于
      This patch introduces a new per connection MaxXmitDataSegmentLength
      parameter value used to represent the outgoing MaxRecvDataSegmentLength
      that is actually sent over the wire during iSCSI login response back
      to the initiator side.
      
      It also adds a new MaxXmitDataSegmentLength configfs attribute to
      represent this value within the existing TPG parameter group under
      /sys/kernel/config/target/iscsi/$TARGETNAME/$TPGT/param/
      
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e004cb25
  2. 23 9月, 2012 1 次提交
  3. 18 9月, 2012 3 次提交
  4. 27 8月, 2012 1 次提交
  5. 21 7月, 2012 1 次提交
    • A
      iscsi-target: Drop bogus struct file usage for iSCSI/SCTP · bf6932f4
      Al Viro 提交于
      From Al Viro:
      
      	BTW, speaking of struct file treatment related to sockets -
              there's this piece of code in iscsi:
              /*
               * The SCTP stack needs struct socket->file.
               */
              if ((np->np_network_transport == ISCSI_SCTP_TCP) ||
                  (np->np_network_transport == ISCSI_SCTP_UDP)) {
                      if (!new_sock->file) {
                              new_sock->file = kzalloc(
                                              sizeof(struct file), GFP_KERNEL);
      
      For one thing, as far as I can see it'not true - sctp does *not* depend on
      socket->file being non-NULL; it does, in one place, check socket->file->f_flags
      for O_NONBLOCK, but there it treats NULL socket->file as "flag not set".
      Which is the case here anyway - the fake struct file created in
      __iscsi_target_login_thread() (and in iscsi_target_setup_login_socket(), with
      the same excuse) do *not* get that flag set.
      
      Moreover, it's a bloody serious violation of a bunch of asserts in VFS;
      all struct file instances should come from filp_cachep, via get_empty_filp()
      (or alloc_file(), which is a wrapper for it).  FWIW, I'm very tempted to
      do this and be done with the entire mess:
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      bf6932f4
  6. 17 7月, 2012 5 次提交
  7. 21 5月, 2012 1 次提交
    • N
      iscsi-target: Fix iov_count calculation bug in iscsit_allocate_iovecs · f80e8ed3
      Nicholas Bellinger 提交于
      This patch fixes a bug in iscsit_allocate_iovecs() where iov_count was
      incorrectly calculated using min(1UL, data_length / PAGE_SIZE) instead of
      max(1UL, data_length / PAGE_SIZE), that ends up triggering an OOPs for
      large block I/O when the SGL <-> iovec mapping exceeds the bogus iov_count
      allocation size.
      
      This is a regression introduced during the iscsi-target conversion back
      to using core memory allocation here:
      
      commit bfb79eac
      Author: Andy Grover <agrover@redhat.com>
      Date:   Tue Apr 3 15:51:29 2012 -0700
      
          target/iscsi: Go back to core allocating data buffer for cmd
      
      Cc: Andy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f80e8ed3
  8. 18 5月, 2012 1 次提交
  9. 07 5月, 2012 1 次提交
  10. 15 4月, 2012 11 次提交
  11. 18 3月, 2012 1 次提交
  12. 16 3月, 2012 2 次提交
  13. 14 3月, 2012 1 次提交
    • N
      iscsi-target: Fix reservation conflict -EBUSY response handling bug · 00fdc6bb
      Nicholas Bellinger 提交于
      This patch addresses a iscsi-target specific bug related to reservation conflict
      handling in iscsit_handle_scsi_cmd() that has been causing reservation conflicts
      to complete and not fail as expected due to incorrect errno checking.  The problem
      occured with the change to return -EBUSY from transport_generic_cmd_sequencer() ->
      transport_generic_allocate_tasks() failures, that broke iscsit_handle_scsi_cmd()
      checking for -EINVAL in order to invoke a non GOOD status response.
      
      This was manifesting itself as data corruption with legacy SPC-2 reservations,
      but also effects iscsi-target LUNs with SPC-3 persistent reservations.
      
      This bug was originally introduced in lio-core commit:
      
      commit 03e98c9e
      Author: Nicholas Bellinger <nab@linux-iscsi.org>
      Date:   Fri Nov 4 02:36:16 2011 -0700
      
          target: Address legacy PYX_TRANSPORT_* return code breakage
      Reported-by: NMartin Svec <martin.svec@zoner.cz>
      Cc: Martin Svec <martin.svec@zoner.cz>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      00fdc6bb
  14. 11 3月, 2012 4 次提交