1. 22 7月, 2011 2 次提交
    • A
      target: Core cleanups from AGrover (round 1) · e3d6f909
      Andy Grover 提交于
      This patch contains the squashed version of a number of cleanups and
      minor fixes from Andy's initial series (round 1) for target core this
      past spring.  The condensed log looks like:
      
      target: use errno values instead of returning -1 for everything
      target: Rename transport_calc_sg_num to transport_init_task_sg
      target: Fix leak in error path in transport_init_task_sg
      target/pscsi: Remove pscsi_get_sh() usage
      target: Make two runtime checks into WARN_ONs
      target: Remove hba queue depth and convert to spin_lock_irq usage
      target: dev->dev_status_queue_obj is unused
      target: Make struct se_queue_req.cmd type struct se_cmd *
      target: Remove __transport_get_qr_from_queue()
      target: Rename se_dev->g_se_dev_list to se_dev_node
      target: Remove struct se_global
      target: Simplify scsi mib index table code
      target: Make dev_queue_obj a member of se_device instead of a pointer
      target: remove extraneous returns at end of void functions
      target: Ensure transport_dump_vpd_ident_type returns null-terminated str
      target: Function pointers don't need to use '&' to be assigned
      target: Fix comment in __transport_execute_tasks()
      target: Misc style cleanups
      target: rename struct pr_reservation_template to pr_reservation
      target: Remove #defines that just perform indirection
      target: Inline transport_get_task_from_execute_queue()
      target: Minor header comment fixes
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e3d6f909
    • N
      target: Remove unused su_group usage in fabric register/dergister · a8c6da90
      Nicholas Bellinger 提交于
      This patch removes two instances of left over v3.x code performing local
      scope access to struct target_core_fabric_ops->tf_subsys->su_group in
      target_fabric_configfs_register() and target_fabric_configfs_deregister().
      Reported-by: NChristophe Fergeau <cfergeau@gmail.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      a8c6da90
  2. 24 6月, 2011 2 次提交
  3. 27 5月, 2011 1 次提交
  4. 25 5月, 2011 1 次提交
  5. 24 3月, 2011 4 次提交
    • N
      [SCSI] target: add initial statistics · 12d23384
      Nicholas Bellinger 提交于
      This patch adds a target_core_mib.c statistics conversion for
      backend context struct se_subsystem_dev + struct se_device config_group
      based statistics in target_core_device.c using CONFIGFS_EATTR()
      based struct config_item_types from target_core_stat.c code.
      
      The conversion from backend /proc/scsi_target/mib/ context output to configfs
      default groups+attributes include scsi_dev, scsi_lu, and scsi_tgt_dev output
      from within individual:
      
      	/sys/kernel/config/target/core/$HBA/DEV/
      
      The legacy procfs output now appear as individual configfs attributes under:
      
      *) $HBA/$DEV/statistics/scsi_dev:
      
      |-- indx
      |-- inst
      |-- ports
      `-- role
      
      *) $HBA/$DEV/statistics/scsi_lu:
      
      |-- creation_time
      |-- dev
      |-- dev_type
      |-- full_stat
      |-- hs_num_cmds
      |-- indx
      |-- inst
      |-- lu_name
      |-- lun
      |-- num_cmds
      |-- prod
      |-- read_mbytes
      |-- resets
      |-- rev
      |-- state_bit
      |-- status
      |-- vend
      `-- write_mbytes
      
      *) $HBA/$DEV/statistics/scsi_tgt_dev:
      
      |-- indx
      |-- inst
      |-- non_access_lus
      |-- num_lus
      |-- resets
      `-- status
      
      The conversion from backend /proc/scsi_target/mib/ context output to configfs
      default groups+attributes include scsi_port, scsi_tgt_port and scsi_transport
      output from within individual:
      
      	/sys/kernel/config/target/fabric/$WWN/tpgt_$TPGT/lun/lun_$LUN_ID/statistics/
      
      The legacy procfs output now appear as individual configfs attributes under:
      
      *) fabric/$WWN/tpgt_$TPGT/lun/lun_$LUN_ID/statistics/scsi_port
      
      |-- busy_count
      |-- dev
      |-- indx
      |-- inst
      `-- role
      
      *) fabric/$WWN/tpgt_$TPGT/lun/lun_$LUN_ID/statistics/scsi_tgt_port
      
      |-- dev
      |-- hs_in_cmds
      |-- in_cmds
      |-- indx
      |-- inst
      |-- name
      |-- port_index
      |-- read_mbytes
      `-- write_mbytes
      
      *) fabric/$WWN/tpgt_$TPGT/lun/lun_$LUN_ID/statistics/scsi_transport
      
      |-- dev_name
      |-- device
      |-- indx
      `-- inst
      
      The conversion from backend /proc/scsi_target/mib/ context output to configfs
      default groups+attributes include scsi_att_intr_port and scsi_auth_intr output
      from within individual:
      
      	/sys/kernel/config/target/fabric/$WWN/tpgt_$TPGT/acls/$INITIATOR_WWN/lun_$LUN_ID/statistics/
      
      The legacy procfs output now appear as individual configfs attributes under:
      
      *) acls/$INITIATOR_WWN/lun_$LUN_ID/statistics/scsi_att_intr_port
      
      |-- dev
      |-- indx
      |-- inst
      |-- port
      |-- port_auth_indx
      `-- port_ident
      
      *) acls/$INITIATOR_WWN/lun_$LUN_ID/statistics/scsi_auth_intr
      
      |-- att_count
      |-- creation_time
      |-- dev
      |-- dev_or_port
      |-- hs_num_cmds
      |-- indx
      |-- inst
      |-- intr_name
      |-- map_indx
      |-- num_cmds
      |-- port
      |-- read_mbytes
      |-- row_status
      `-- write_mbytes
      
      Also, this includes adding struct target_fabric_configfs_template->
      tfc_wwn_fabric_stats_cit and ->tfc_tpg_nacl_stat_cit respectively for
      use during target_core_fabric_configfs.c:target_fabric_setup_cits()
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      12d23384
    • A
      [SCSI] target: Add __init/__exit annotation for target_core_[init,exit]_configfs · 54550fab
      Axel Lin 提交于
      This patch fixes the follownig section mismatch warning:
      
      WARNING: vmlinux.o(.text+0x21617a): Section mismatch in reference from the
      function target_core_init_configfs() to the function .init.text:rd_module_init()
      
      The function target_core_init_configfs() references the function __init
      rd_module_init().  This is often because target_core_init_configfs() lacks
      a __init annotation or the annotation of rd_module_init is wrong.
      Signed-off-by: NAxel Lin <axel.lin@gmail.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      54550fab
    • N
      [SCSI] target: Convert backend ->create_virtdevice() call to return ERR_PTR · 613640e4
      Nicholas Bellinger 提交于
      This patch converts the target_core_store_dev_enable() -> struct
      se_subsystem_api->create_virtdevice() call to return proper ERR_PTR values
      back up to configfs logic during backend dependent struct se_device ENABLE
      exception conditions.
      
      Along with the change to target_core_configfs.c, this includes converting IBLOCK,
      FILEIO, pSCSI, and RAMDISK_* backend subsystem plugins to obtain upper level
      PTR_ERR return codes (where available), and return via ERR_PTR during a
      *_create_virtdev() failure.
      Reported-by: NFubo Chen <fubo.chen@gmail.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      613640e4
    • J
      [SCSI] target: Fix match_strdup() memory leaks · 6d180253
      Jesper Juhl 提交于
      match_strdup() dynamically allocates memory and it is the responsabillity
      of the caller to free that memory. The following three cases:
      
      drivers/target/target_core_file.c:fd_set_configfs_dev_params()
      drivers/target/target_core_iblock.c:iblock_set_configfs_dev_params()
      drivers/target/target_core_configfs.c:target_core_dev_pr_store_attr_res_aptpl_metadata()
      
      should be kfree()'ing the allocated memory once it is no longer needed.
      It also makes sure to return -ENOMEM if the memory allocation in match_strdup()
      should fail.  For target_core_configfs.c, this patch adds kfree()'s around
      Opt_initiator_fabric, Opt_initiator_node, Opt_initiator_sid, Opt_sa_res_key,
      Opt_target_fabric, and Opt_target_node for the Persistent Reservations
      Activate Persistence across Target Power Loss (APTPL=1) token parsing.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      6d180253
  6. 13 2月, 2011 3 次提交
    • N
      [SCSI] target: fix use after free detected by SLUB poison · 1f6fe7cb
      Nicholas Bellinger 提交于
      This patch moves a large number of memory release paths inside of the
      configfs callback target_core_hba_item_ops->release() called from
      within fs/configfs/item.c: config_item_cleanup() context.  This patch
      resolves the SLUB 'Poison overwritten' warnings.
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      1f6fe7cb
    • N
      [SCSI] target: Remove procfs based target_core_mib.c code · e89d15ee
      Nicholas Bellinger 提交于
      This patch removes the legacy procfs based target_core_mib.c code,
      and moves the necessary scsi_index_tables functions and defines into
      target_core_transport.c and target_core_base.h code to allow existing
      fabric independent statistics to function.
      
      This includes the removal of a handful of 'atomic_t mib_ref_count'
      counters used in struct se_node_acl, se_session and se_hba to prevent
      removal while using seq_list procfs walking logic.
      
      [jejb: fix up compile failures]
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      e89d15ee
    • N
      [SCSI] target: Fix top-level configfs_subsystem default_group shutdown breakage · 7c2bf6e9
      Nicholas Bellinger 提交于
      This patch fixes two bugs uncovered during testing with
      slub_debug=FPUZ during module_exit() -> target_core_exit_configfs()
      with release of configfs subsystem consumer default groups, namely how
      this should be working with
      fs/configfs/dir.c:configfs_unregister_subsystem() release logic for
      struct config_group->default_group.
      
      The first issue involves configfs_unregister_subsystem() expecting to
      walk+drain the top-level subsys->su_group.default_groups directly in
      unlink_group(), and not directly from the configfs subsystem consumer
      for the top level struct config_group->default_groups.  This patch
      drops the walk+drain of subsys->su_group.default_groups from TCM
      configfs subsystem consumer code, and moves the top-level
      ->default_groups kfree() after configfs_unregister_subsystem() has
      been called.
      
      The second issue involves calling
      core_alua_free_lu_gp(se_global->default_lu_gp) to release the
      default_lu_gp->lu_gp_group before configfs_unregister_subsystem() has
      been called.  This patches also moves the core_alua_free_lu_gp() call
      to release default_lu_group->lu_gp_group after the subsys has been
      unregistered.
      
      Finally, this patch explictly clears the
      [lu_gp,alua,hba]_cg->default_groups pointers after kfree() to ensure
      that no stale memory is picked up from child struct
      config_group->default_group[] while configfs_unregister_subsystem() is
      called.
      Reported-by: NFubo Chen <fubo.chen@gmail.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      7c2bf6e9
  7. 15 1月, 2011 1 次提交
    • N
      [SCSI] target: Add LIO target core v4.0.0-rc6 · c66ac9db
      Nicholas Bellinger 提交于
      LIO target is a full featured in-kernel target framework with the
      following feature set:
      
      High-performance, non-blocking, multithreaded architecture with SIMD
      support.
      
      Advanced SCSI feature set:
      
          * Persistent Reservations (PRs)
          * Asymmetric Logical Unit Assignment (ALUA)
          * Protocol and intra-nexus multiplexing, load-balancing and failover (MC/S)
          * Full Error Recovery (ERL=0,1,2)
          * Active/active task migration and session continuation (ERL=2)
          * Thin LUN provisioning (UNMAP and WRITE_SAMExx)
      
      Multiprotocol target plugins
      
      Storage media independence:
      
          * Virtualization of all storage media; transparent mapping of IO to LUNs
          * No hard limits on number of LUNs per Target; maximum LUN size ~750 TB
          * Backstores: SATA, SAS, SCSI, BluRay, DVD, FLASH, USB, ramdisk, etc.
      
      Standards compliance:
      
          * Full compliance with IETF (RFC 3720)
          * Full implementation of SPC-4 PRs and ALUA
      
      Significant code cleanups done by Christoph Hellwig.
      
      [jejb: fix up for new block bdev exclusive interface. Minor fixes from
       Randy Dunlap and Dan Carpenter.]
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      c66ac9db