Commit d5db84a8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'scsi-target-for-v4.10' of...

Merge branch 'scsi-target-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/bvanassche/linux

Pull scsi target cleanups from Bart Van Assche:
 "The changes here are:

   - a few small bug fixes for the iSCSI and user space target drivers.

   - minimize the target build time by about 30% by rearranging #include
     directives

   - fix the second argument passed to percpu_ida_alloc()

   - reduce the number of false positive warnings reported by sparse

  These patches pass Wu Fengguang's build bot tests and also the
  linux-next tests"

* 'scsi-target-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/bvanassche/linux:
  iscsi-target: Return error if unable to add network portal
  target: Fix spelling mistake and unwrap multi-line text
  target/iscsi: Fix double free in lio_target_tiqn_addtpg()
  target/user: Fix use-after-free of tcmu_cmds if they are expired
  target: Minimize #include directives
  target/user: Add an #include directive
  cxgbit: Add an #include directive
  ibmvscsi_tgt: Add two #include directives
  sbp-target: Add an #include directive
  qla2xxx: Add an #include directive
  configfs: Minimize #include directives
  usb: gadget: Fix second argument of percpu_ida_alloc()
  sbp-target: Fix second argument of percpu_ida_alloc()
  target/user: Fix a data type in tcmu_queue_cmd()
  target: Use NULL instead of 0 to represent a pointer
parents f8114f85 83337e54
......@@ -4,6 +4,10 @@
#define DECIMAL 0
#define HEX 1
struct iscsi_conn;
struct iscsi_login;
struct iscsi_np;
extern void convert_null_to_semi(char *, int);
extern int extract_param(const char *, const char *, unsigned int, char *,
unsigned char *);
......
#ifndef ISCSI_TARGET_NODEATTRIB_H
#define ISCSI_TARGET_NODEATTRIB_H
#include <linux/types.h>
struct iscsi_node_acl;
struct iscsi_portal_group;
extern void iscsit_set_default_node_attribues(struct iscsi_node_acl *,
struct iscsi_portal_group *);
extern int iscsit_na_dataout_timeout(struct iscsi_node_acl *, u32);
......
......@@ -17,7 +17,7 @@
******************************************************************************/
#include <linux/slab.h>
#include <linux/uio.h> /* struct kvec */
#include <target/iscsi/iscsi_target_core.h>
#include "iscsi_target_util.h"
#include "iscsi_target_parameters.h"
......
#ifndef ISCSI_PARAMETERS_H
#define ISCSI_PARAMETERS_H
#include <linux/types.h>
#include <scsi/iscsi_proto.h>
struct iscsi_extra_response {
......@@ -23,6 +24,11 @@ struct iscsi_param {
struct list_head p_list;
} ____cacheline_aligned;
struct iscsi_conn;
struct iscsi_conn_ops;
struct iscsi_param_list;
struct iscsi_sess_ops;
extern int iscsi_login_rx_data(struct iscsi_conn *, char *, int);
extern int iscsi_login_tx_data(struct iscsi_conn *, char *, char *, int);
extern void iscsi_dump_conn_ops(struct iscsi_conn_ops *);
......
#ifndef ISCSI_SEQ_AND_PDU_LIST_H
#define ISCSI_SEQ_AND_PDU_LIST_H
#include <linux/types.h>
#include <linux/cache.h>
/* struct iscsi_pdu->status */
#define DATAOUT_PDU_SENT 1
......@@ -78,6 +81,8 @@ struct iscsi_seq {
u32 xfer_len;
} ____cacheline_aligned;
struct iscsi_cmd;
extern int iscsit_build_pdu_and_seq_lists(struct iscsi_cmd *, u32);
extern struct iscsi_pdu *iscsit_get_pdu_holder(struct iscsi_cmd *, u32, u32);
extern struct iscsi_pdu *iscsit_get_pdu_holder_for_seq(struct iscsi_cmd *, struct iscsi_seq *);
......
#ifndef ISCSI_TARGET_TMR_H
#define ISCSI_TARGET_TMR_H
#include <linux/types.h>
struct iscsi_cmd;
struct iscsi_conn;
struct iscsi_tmr_req;
extern u8 iscsit_tmr_abort_task(struct iscsi_cmd *, unsigned char *);
extern int iscsit_tmr_task_warm_reset(struct iscsi_conn *, struct iscsi_tmr_req *,
unsigned char *);
......
......@@ -16,9 +16,9 @@
* GNU General Public License for more details.
******************************************************************************/
#include <linux/slab.h>
#include <target/target_core_base.h>
#include <target/target_core_fabric.h>
#include <target/iscsi/iscsi_target_core.h>
#include "iscsi_target_erl0.h"
#include "iscsi_target_login.h"
......@@ -260,7 +260,6 @@ int iscsit_tpg_add_portal_group(struct iscsi_tiqn *tiqn, struct iscsi_portal_gro
iscsi_release_param_list(tpg->param_list);
tpg->param_list = NULL;
}
kfree(tpg);
return -ENOMEM;
}
......
#ifndef ISCSI_TARGET_TPG_H
#define ISCSI_TARGET_TPG_H
#include <linux/types.h>
struct iscsi_np;
struct iscsi_session;
struct iscsi_tiqn;
struct iscsi_tpg_np;
struct se_node_acl;
struct sockaddr_storage;
extern struct iscsi_portal_group *iscsit_alloc_portal_group(struct iscsi_tiqn *, u16);
extern int iscsit_load_discovery_tpg(void);
extern void iscsit_release_discovery_tpg(void);
......
#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/module.h>
#include <target/iscsi/iscsi_transport.h>
static LIST_HEAD(g_transport_list);
......
......@@ -18,6 +18,7 @@
#include <linux/list.h>
#include <linux/percpu_ida.h>
#include <net/ipv6.h> /* ipv6_addr_equal() */
#include <scsi/scsi_tcq.h>
#include <scsi/iscsi_proto.h>
#include <target/target_core_base.h>
......
#ifndef ISCSI_TARGET_UTIL_H
#define ISCSI_TARGET_UTIL_H
#include <linux/types.h>
#include <scsi/iscsi_proto.h> /* itt_t */
#define MARKER_SIZE 8
struct iscsi_cmd;
struct iscsi_conn;
struct iscsi_conn_recovery;
struct iscsi_session;
extern int iscsit_add_r2t_to_list(struct iscsi_cmd *, u32, u32, int, u32);
extern struct iscsi_r2t *iscsit_get_r2t_for_eos(struct iscsi_cmd *, u32, u32);
extern struct iscsi_r2t *iscsit_get_r2t_from_list(struct iscsi_cmd *);
......
#include <linux/types.h>
#include <linux/device.h>
#include <target/target_core_base.h> /* struct se_cmd */
#define TCM_LOOP_VERSION "v2.1-rc2"
#define TL_WWN_ADDR_LEN 256
#define TL_TPGS_PER_HBA 32
......
......@@ -28,6 +28,7 @@
#include <linux/string.h>
#include <linux/configfs.h>
#include <linux/ctype.h>
#include <linux/delay.h>
#include <linux/firewire.h>
#include <linux/firewire-constants.h>
#include <scsi/scsi_proto.h>
......@@ -928,7 +929,7 @@ static struct sbp_target_request *sbp_mgt_get_req(struct sbp_session *sess,
struct sbp_target_request *req;
int tag;
tag = percpu_ida_alloc(&se_sess->sess_tag_pool, GFP_ATOMIC);
tag = percpu_ida_alloc(&se_sess->sess_tag_pool, TASK_RUNNING);
if (tag < 0)
return ERR_PTR(-ENOMEM);
......
......@@ -26,8 +26,11 @@
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/configfs.h>
#include <linux/delay.h>
#include <linux/export.h>
#include <linux/fcntl.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <scsi/scsi_proto.h>
#include <asm/unaligned.h>
......
#ifndef TARGET_CORE_ALUA_H
#define TARGET_CORE_ALUA_H
#include <target/target_core_base.h>
/*
* INQUIRY response data, TPGS Field
*
......
......@@ -144,12 +144,12 @@ static ssize_t target_core_item_dbroot_store(struct config_item *item,
return -EINVAL;
}
if (!S_ISDIR(file_inode(fp)->i_mode)) {
filp_close(fp, 0);
filp_close(fp, NULL);
mutex_unlock(&g_tf_lock);
pr_err("db_root: not a directory: %s\n", db_root_stage);
return -EINVAL;
}
filp_close(fp, 0);
filp_close(fp, NULL);
strncpy(db_root, db_root_stage, read_bytes);
......
......@@ -33,6 +33,7 @@
#include <linux/kthread.h>
#include <linux/in.h>
#include <linux/export.h>
#include <linux/t10-pi.h>
#include <asm/unaligned.h>
#include <net/sock.h>
#include <net/tcp.h>
......
......@@ -32,6 +32,7 @@
#include <linux/module.h>
#include <linux/vmalloc.h>
#include <linux/falloc.h>
#include <linux/uio.h>
#include <scsi/scsi_proto.h>
#include <asm/unaligned.h>
......
#ifndef TARGET_CORE_FILE_H
#define TARGET_CORE_FILE_H
#include <target/target_core_base.h>
#define FD_VERSION "4.0"
#define FD_MAX_DEV_NAME 256
......
#ifndef TARGET_CORE_IBLOCK_H
#define TARGET_CORE_IBLOCK_H
#include <linux/atomic.h>
#include <target/target_core_base.h>
#define IBLOCK_VERSION "4.0"
#define IBLOCK_MAX_CDBS 16
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment