1. 13 6月, 2012 7 次提交
    • R
      qla2xxx: Don't leak commands we give up on in qlt_do_work() · fae9eaf8
      Roland Dreier 提交于
      If we go to the "out_term:" exit path in qlt_do_work(), we call
      qlt_send_term_exchange() with a NULL cmd, which means that it can't
      possibly free the cmd for us.  Add an explicit call to free the
      command memory, so we don't leak the allocation.
      
      This will also fix warnings about "BUG qla_tgt_cmd_cachep: Objects
      remaining on kmem_cache_close" from slub when unloading the qla2xxx
      target module.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      fae9eaf8
    • R
      qla2xxx: Don't crash if we can't find cmd for failed CTIO · 092e1dc3
      Roland Dreier 提交于
      In qlt_do_ctio_completion(), there's no point in calling
      qlt_term_ctio_exchange() with a NULL cmd -- all that it does is crash
      in a NULL pointer dereference, since it does
      
      	qlt_send_term_exchange(vha, cmd, &cmd->atio, 1);
      
      and dereferencing &cmd->atio is a bad idea if cmd itself is NULL.
      
      If we really need to do this, we could take the values from the
      failed CTIO we're processing, but it's not clear if it's worth
      the replumbing to do that.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      092e1dc3
    • R
      tcm_qla2xxx: Don't insert nacls without sessions into the btree · 3578ddba
      Roland Dreier 提交于
      When we create an explicit node ACL in tcm_qla2xxx_make_nodeacl(),
      there is a call to tcm_qla2xxx_setup_nacl_from_rport(), which puts the
      node ACL into the lport_fcport_map even though there is no session yet
      for the initiator.  Since the only time we remove entries from this
      map is when we free a session, this means that if we later delete this
      node ACL without the initiator ever creating a session, we'll leave
      the nacl pointer in the btree pointing at freed memory.
      
      This is especially bad if that initiator later does send us a command
      that would cause us to create a dynamic ACL and session: we'll find
      the stale freed nacl pointer in the btree and end up with use-after-free.
      
      We could add more code to clear the btree entry when deleting the
      explicit nacl, but the original insertion is pointless: without a
      session attached, we'll just have to update the entry when a session
      appears anyway.  So we can just delete tcm_qla2xxx_setup_nacl_from_rport()
      and the code that calls it.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Cc: Chad Dupuis <chad.dupuis@qlogic.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Cc: Arun Easi <arun.easi@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      3578ddba
    • R
      target: Return error to initiator if SET TARGET PORT GROUPS emulation fails · 59e4f541
      Roland Dreier 提交于
      The error paths in target_emulate_set_target_port_groups() are all
      essentially "rc = -EINVAL; goto out;" but the code at "out:" ignores
      rc and always returns success.  This means that even if eg explicit
      ALUA is turned off, the initiator will always see a good SCSI status
      for SET TARGET PORT GROUPS.
      
      Fix this by returning rc as is intended.  It appears this bug was
      added by the following patch:
      
      commit 05d1c7c0
      Author: Andy Grover <agrover@redhat.com>
      Date:   Wed Jul 20 19:13:28 2011 +0000
      
          target: Make all control CDBs scatter-gather
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      59e4f541
    • N
      tcm_qla2xxx: Clear session s_id + loop_id earlier during shutdown · f2d5d9b9
      Nicholas Bellinger 提交于
      This patch adds a new tcm_qla2xxx_clear_sess_lookup() call to clear session
      specific s_id + loop_id entries used for se_node_acl pointer lookup ahead
      of releasing se_session within the process context workqueue callback in
      tcm_qla2xxx_free_session().
      
      It makes the call in existing tcm_qla2xxx_clear_nacl_from_fcport_map()
      code invoked from qlt_unreg_sess() in interrupt context w/ hardware_lock
      held, ahead of the process context callback into qlt_free_session_done()
      -> tcm_qla2xxx_free_session().
      
      We are doing this to address a race between incoming ATIO or TMR packets
      using stale se_node_acl pointer once session shutdown has been invoked via
      qlt_unreg_sess() in qla_target.c LLD code, and when the entire tcm_qla2xxx
      endpoint has not been forced into shutdown w/ echo 0 > ../$QLA2XXX_PORT/enable
      
      Cc: Joern Engel <joern@logfs.org>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Arun Easi <arun.easi@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f2d5d9b9
    • J
      tcm_qla2xxx: Convert to TFO->put_session() usage · aaf68b75
      Joern Engel 提交于
      This patch converts tcm_qla2xxx code to use an internal kref_put() for
      se_session->sess_kref in order to ensure that qla_hw_data->hardware_lock
      can be held while calling qlt_unreg_sess() for the final put.
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Arun Easi <arun.easi@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      aaf68b75
    • J
      target: Add TFO->put_session() caller for HW fabric session shutdown · 4149268e
      Joern Engel 提交于
      This patch adds an optional target_core_fabric_ops->put_session() caller
      within the existing target_put_session() code path.
      
      This is required by tcm_qla2xxx code in order to invoke it's own fabric
      specific session shutdown handler using se_session->sess_kref.
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Arun Easi <arun.easi@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      4149268e
  2. 09 6月, 2012 1 次提交
    • L
      Revert "drm/i915/crt: Do not rely upon the HPD presence pin" · 8f53369b
      Linus Torvalds 提交于
      This reverts commit 9e612a00.
      
      It incorrectly finds VGA connectors where none are attached, apparently
      not noticing that nothing replied to the EDID queries, and happily using
      the default EDID modes that have nothing to do with actual hardware.
      
      That in turn then causes X to fall down to the lowest common
      denominator, which is usually the default 1024x768 mode that is in the
      default EDID and pretty much anything supports).
      
      I'd suggest that if not relying on the HDP pin, the code should at least
      check whether it gets valid EDID data back, rather than just assume
      there's something on the VGA connector.
      
      Cc: Dave Airlie <airlied@linux.ie>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8f53369b
  3. 08 6月, 2012 1 次提交
  4. 07 6月, 2012 5 次提交
  5. 06 6月, 2012 2 次提交
  6. 05 6月, 2012 14 次提交
  7. 04 6月, 2012 7 次提交
  8. 03 6月, 2012 3 次提交
    • N
      target/file: Use O_DSYNC by default for FILEIO backends · a4dff304
      Nicholas Bellinger 提交于
      Convert to use O_DSYNC for all cases at FILEIO backend creation time to
      avoid the extra syncing of pure timestamp updates with legacy O_SYNC during
      default operation as recommended by hch.  Continue to do this independently of
      Write Cache Enable (WCE) bit, as WCE=0 is currently the default for all backend
      devices and enabled by user on per device basis via attrib/emulate_write_cache.
      
      This patch drops the now unnecessary fd_buffered_io= token usage that was
      originally signalling when to explictly disable O_SYNC at backend creation
      time for buffered I/O operation.  This can end up being dangerous for a number
      of reasons during physical node failure, so go ahead and drop this option
      for now when O_DSYNC is used as the default.
      
      Also allow explict FUA WRITEs -> vfs_fsync_range() call to function in
      fd_execute_cmd() independently of WCE bit setting.
      Reported-by: NChristoph Hellwig <hch@lst.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      a4dff304
    • J
      dm thin: provide userspace access to pool metadata · cc8394d8
      Joe Thornber 提交于
      This patch implements two new messages that can be sent to the thin
      pool target allowing it to take a snapshot of the _metadata_.  This,
      read-only snapshot can be accessed by userland, concurrently with the
      live target.
      
      Only one metadata snapshot can be held at a time.  The pool's status
      line will give the block location for the current msnap.
      
      Since version 0.1.5 of the userland thin provisioning tools, the
      thin_dump program displays the msnap as follows:
      
          thin_dump -m <msnap root> <metadata dev>
      
      Available here: https://github.com/jthornber/thin-provisioning-tools
      
      Now that userland can access the metadata we can do various things
      that have traditionally been kernel side tasks:
      
           i) Incremental backups.
      
           By using metadata snapshots we can work out what blocks have
           changed over time.  Combined with data snapshots we can ensure
           the data doesn't change while we back it up.
      
           A short proof of concept script can be found here:
      
           https://github.com/jthornber/thinp-test-suite/blob/master/incremental_backup_example.rb
      
           ii) Migration of thin devices from one pool to another.
      
           iii) Merging snapshots back into an external origin.
      
           iv) Asyncronous replication.
      Signed-off-by: NJoe Thornber <ejt@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      cc8394d8
    • M
      dm thin: use slab mempools · a24c2569
      Mike Snitzer 提交于
      Use dedicated caches prefixed with a "dm_" name rather than relying on
      kmalloc mempools backed by generic slab caches so the memory usage of
      thin provisioning (and any leaks) can be accounted for independently.
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      a24c2569