1. 20 2月, 2013 1 次提交
  2. 28 11月, 2012 1 次提交
  3. 08 11月, 2012 1 次提交
  4. 07 11月, 2012 1 次提交
    • C
      target: pass sense_reason as a return value · de103c93
      Christoph Hellwig 提交于
      Pass the sense reason as an explicit return value from the I/O submission
      path instead of storing it in struct se_cmd and using negative return
      values.  This cleans up a lot of the code pathes, and with the sparse
      annotations for the new sense_reason_t type allows for much better
      error checking.
      
      (nab: Convert spc_emulate_modesense + spc_emulate_modeselect to use
            sense_reason_t with Roland's MODE SELECT changes)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      de103c93
  5. 01 11月, 2012 1 次提交
    • R
      iscsi-target: Fix missed wakeup race in TX thread · d5627acb
      Roland Dreier 提交于
      The sleeping code in iscsi_target_tx_thread() is susceptible to the classic
      missed wakeup race:
      
       - TX thread finishes handle_immediate_queue() and handle_response_queue(),
         thinks both queues are empty.
       - Another thread adds a queue entry and does wake_up_process(), which does
         nothing because the TX thread is still awake.
       - TX thread does schedule_timeout() and sleeps forever.
      
      In practice this can kill an iSCSI connection if for example an initiator
      does single-threaded writes and the target misses the wakeup window when
      queueing an R2T; in this case the connection will be stuck until the
      initiator loses patience and does some task management operation (or kills
      the connection entirely).
      
      Fix this by converting to wait_event_interruptible(), which does not
      suffer from this sort of race.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      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>
      d5627acb
  6. 04 10月, 2012 2 次提交
  7. 03 10月, 2012 4 次提交
  8. 23 9月, 2012 1 次提交
  9. 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
  10. 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
  11. 17 7月, 2012 2 次提交
  12. 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
  13. 15 4月, 2012 11 次提交
  14. 16 3月, 2012 1 次提交
  15. 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
  16. 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
  17. 26 2月, 2012 3 次提交
  18. 14 2月, 2012 1 次提交
  19. 18 1月, 2012 2 次提交
  20. 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
  21. 06 12月, 2011 1 次提交