1. 04 10月, 2012 2 次提交
  2. 03 10月, 2012 4 次提交
  3. 23 9月, 2012 1 次提交
  4. 18 9月, 2012 1 次提交
    • R
      target: Simplify fabric sense data length handling · 9c58b7dd
      Roland Dreier 提交于
      Every fabric driver has to supply a se_tfo->set_fabric_sense_len()
      method, just so iSCSI can return an offset of 2.  However, every fabric
      driver is already allocating a sense buffer and passing it into the
      target core, either via transport_init_se_cmd() or target_submit_cmd().
      
      So instead of having iSCSI pass the start of its sense buffer into the
      core and then later tell the core to skip the first 2 bytes, it seems
      easier for iSCSI just to do the offset of 2 when it passes the sense
      buffer into the core.  Then we can drop the se_tfo->set_fabric_sense_len()
      everywhere, and just add a couple of lines of code to iSCSI to set the
      sense data length to the beginning of the buffer right before it sends
      it over the network.
      
      (nab: Remove .set_fabric_sense_len usage from tcm_qla2xxx_npiv_ops +
            change transport_get_sense_buffer to follow v3.6-rc6 code w/o
            ->set_fabric_sense_len usage)
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9c58b7dd
  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 2 次提交
  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. 15 4月, 2012 11 次提交
  9. 16 3月, 2012 1 次提交
  10. 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
  11. 11 3月, 2012 1 次提交
    • N
      iscsi-target: Convert to use target_put_session + sess_kref · 99367f01
      Nicholas Bellinger 提交于
      This patch converts iscsi-target session code to use se_sess->sess_kref
      counting for iscsi session shutdown.  The following cases include:
      
      *) last iscsit_close_connection() shutdown path to invoke close session
      *) iscsit_logout_post_handler_closesession() for explict logout
      *) iscsit_free_session() caller for explict shutdown
      
      It also moves iscsit_stop_session() call from lio_tpg_close_session()
      into lio_tpg_shutdown_session() TFO callbacks to invoke an explict
      shutdown, and also changes iscsi_check_for_session_reinstatement()
      login code to use se_sess->sess_kref.
      
      (v2: Make iscsit_handle_time2retain_timeout() use target_put_session)
      
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      99367f01
  12. 26 2月, 2012 3 次提交
  13. 14 2月, 2012 1 次提交
  14. 18 1月, 2012 2 次提交
  15. 14 12月, 2011 2 次提交
    • J
      target: remove useless casts · 8359cf43
      Jörn Engel 提交于
      A reader should spend an extra moment whenever noticing a cast,
      because either something special is going on that deserves extra
      attention or, as is all too often the case, the code is wrong.
      
      These casts, afaics, have all been useless.  They cast a foo* to a
      foo*, cast a void* to the assigned type, cast a foo* to void*, before
      assigning it to a void* variable, etc.
      
      In a few cases I also removed an additional &...[0], which is equally
      useless.
      
      Lastly I added three FIXMEs where, to the best of my judgement, the
      code appears to have a bug.  It would be good if someone could check
      these.
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      8359cf43
    • C
      target: header reshuffle, part2 · c4795fb2
      Christoph Hellwig 提交于
      This reorganized the headers under include/target into:
      
       - target_core_base.h stays as is with all target-wide data stuctures and defines
       - target_core_backend.h contains the whole interface to I/O backends
       - target_core_fabric.h contains the whole interface to fabric modules
      
      Except for those only the various configfs macro headers stay around.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c4795fb2
  16. 06 12月, 2011 4 次提交
    • T
      iscsi-target: Use kmemdup rather than duplicating its implementation · 1c3d5794
      Thomas Meyer 提交于
      The semantic patch that makes this change is available
      in scripts/coccinelle/api/memdup.cocci.
      Signed-off-by: NThomas Meyer <thomas@m3y3r.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      1c3d5794
    • N
      iscsi-target: Add missing F_BIT for iscsi_tm_rsp · 7ae0b103
      Nicholas Bellinger 提交于
      This patch sets the missing ISCSI_FLAG_CMD_FINAL bit in
      iscsit_send_task_mgt_rsp() for a struct iscsi_tm_rsp PDU.
      
      This usage is hardcoded for all TM response PDUs in RFC-3720
      section 10.6.
      Reported-by: Nwhucecil <whucecil1999@gmail.com>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7ae0b103
    • N
      iscsi-target: Fix residual count hanlding + remove iscsi_cmd->residual_count · 7e46cf02
      Nicholas Bellinger 提交于
      This patch fixes iscsi-target handling of underflow where residual data is
      causing an OOPs by using the incorrect iscsi_cmd_t->data_length initially
      assigned in iscsit_allocate_se_cmd().  It resets iscsi_cmd_t->data_length
      from se_cmd_t->data_length after transport_generic_allocate_tasks()
      has been invoked in iscsit_handle_scsi_cmd() RX context, and converts
      iscsi_cmd->residual_count usage to access iscsi_cmd->se_cmd.residual_count
      to get the proper residual count set by target-core.
      
      Reported-by: <lists@internyc.net>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7e46cf02
    • N
      target: Address legacy PYX_TRANSPORT_* return code breakage · 03e98c9e
      Nicholas Bellinger 提交于
      This patch removes legacy usage of PYX_TRANSPORT_* return codes in a number
      of locations and addresses cases where transport_generic_request_failure()
      was returning the incorrect sense upon CHECK_CONDITION status after the
      v3.1 converson to use errno return codes.
      
      This includes the conversion of transport_generic_request_failure() to
      process cmd->scsi_sense_reason and handle extra TCM_RESERVATION_CONFLICT
      before calling transport_send_check_condition_and_sense() to queue up
      response status.  It also drops PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES legacy
      usgae, and returns TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE w/ a response
      for these cases.
      
      transport_generic_allocate_tasks(), transport_generic_new_cmd(), backend
      SCF_SCSI_DATA_SG_IO_CDB ->do_task(), and emulated ->execute_task() have
      all been updated to set se_cmd->scsi_sense_reason and return errno codes
      universally upon failure.  This includes cmd->scsi_sense_reason assignment
      in target_core_alua.c, target_core_pr.c and target_core_cdb.c emulation code.
      
      Finally it updates fabric modules to remove the legacy usage, and for
      TFO->new_cmd_map() callers forwards return values outside of fabric code.
      iscsi-target has also been updated to remove a handful of special cases
      related to the cleanup and signaling QUEUE_FULL handling w/ ft_write_pending()
      
      (v2: Drop extra SCF_SCSI_CDB_EXCEPTION check during failure from
           transport_generic_new_cmd, and re-add missing task->task_error_status
           assignment in transport_complete_task)
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      03e98c9e
  17. 02 11月, 2011 2 次提交
    • N
      iscsi-target: Fix non-immediate TMR handling · 5a4c8666
      Nicholas Bellinger 提交于
      This patch addresses two issues with non immediate TMR handling in
      iscsit_handle_task_mgt_cmd().  The first involves breakage due to
      v3.1-rc conversion of iscsit_sequence_cmd(), which upon good status
      would hit the iscsit_add_reject_from_cmd() block of code.  This patch
      adds an explict check for CMDSN_ERROR_CANNOT_RECOVER.
      
      The second adds a check to return when non immediate TMR operation is
      detected after iscsit_ack_from_expstatsn(), as iscsit_sequence_cmd()
      -> iscsit_execute_cmd() will have called transport_generic_handle_tmr()
      for the non immediate TMR case already.
      
      Cc: Andy Grover <agrover@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5a4c8666
    • N
      iscsi-target: Add missing CMDSN_LOWER_THAN_EXP check in iscsit_handle_scsi_cmd · 7e32da55
      Nicholas Bellinger 提交于
      This patch adds a missing CMDSN_LOWER_THAN_EXP return check for
      iscsit_sequence_cmd() in iscsit_handle_scsi_cmd() that was incorrectly
      dropped during the v3.1-rc cleanups to use iscsit_sequence_cmd().
      
      Cc: Andy Grover <agrover@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7e32da55