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
#ifndef TARGET_CORE_INTERNAL_H #ifndef TARGET_CORE_INTERNAL_H
#define TARGET_CORE_INTERNAL_H #define TARGET_CORE_INTERNAL_H
#include <linux/configfs.h>
#include <linux/list.h>
#include <linux/types.h>
#include <target/target_core_base.h>
#define TARGET_CORE_NAME_MAX_LEN 64 #define TARGET_CORE_NAME_MAX_LEN 64
#define TARGET_FABRIC_NAME_SIZE 32 #define TARGET_FABRIC_NAME_SIZE 32
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/file.h> #include <linux/file.h>
#include <linux/fcntl.h>
#include <linux/fs.h>
#include <scsi/scsi_proto.h> #include <scsi/scsi_proto.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
...@@ -253,8 +255,7 @@ target_scsi2_reservation_reserve(struct se_cmd *cmd) ...@@ -253,8 +255,7 @@ target_scsi2_reservation_reserve(struct se_cmd *cmd)
if ((cmd->t_task_cdb[1] & 0x01) && if ((cmd->t_task_cdb[1] & 0x01) &&
(cmd->t_task_cdb[1] & 0x02)) { (cmd->t_task_cdb[1] & 0x02)) {
pr_err("LongIO and Obselete Bits set, returning" pr_err("LongIO and Obsolete Bits set, returning ILLEGAL_REQUEST\n");
" ILLEGAL_REQUEST\n");
return TCM_UNSUPPORTED_SCSI_OPCODE; return TCM_UNSUPPORTED_SCSI_OPCODE;
} }
/* /*
......
#ifndef TARGET_CORE_PR_H #ifndef TARGET_CORE_PR_H
#define TARGET_CORE_PR_H #define TARGET_CORE_PR_H
#include <linux/types.h>
#include <target/target_core_base.h>
/* /*
* PERSISTENT_RESERVE_OUT service action codes * PERSISTENT_RESERVE_OUT service action codes
* *
......
...@@ -15,11 +15,12 @@ ...@@ -15,11 +15,12 @@
#define PS_TIMEOUT_DISK (15*HZ) #define PS_TIMEOUT_DISK (15*HZ)
#define PS_TIMEOUT_OTHER (500*HZ) #define PS_TIMEOUT_OTHER (500*HZ)
#include <linux/device.h> #include <linux/cache.h> /* ___cacheline_aligned */
#include <linux/kref.h> #include <target/target_core_base.h> /* struct se_device */
#include <linux/kobject.h>
struct block_device;
struct scsi_device; struct scsi_device;
struct Scsi_Host;
struct pscsi_plugin_task { struct pscsi_plugin_task {
unsigned char pscsi_sense[TRANSPORT_SENSE_BUFFER]; unsigned char pscsi_sense[TRANSPORT_SENSE_BUFFER];
......
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/parser.h> #include <linux/parser.h>
#include <linux/highmem.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/scatterlist.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <scsi/scsi_proto.h> #include <scsi/scsi_proto.h>
......
#ifndef TARGET_CORE_RD_H #ifndef TARGET_CORE_RD_H
#define TARGET_CORE_RD_H #define TARGET_CORE_RD_H
#include <linux/module.h>
#include <linux/types.h>
#include <target/target_core_base.h>
#define RD_HBA_VERSION "v4.0" #define RD_HBA_VERSION "v4.0"
#define RD_MCP_VERSION "4.0" #define RD_MCP_VERSION "4.0"
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/ratelimit.h> #include <linux/ratelimit.h>
#include <linux/crc-t10dif.h> #include <linux/crc-t10dif.h>
#include <linux/t10-pi.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <scsi/scsi_proto.h> #include <scsi/scsi_proto.h>
#include <scsi/scsi_tcq.h> #include <scsi/scsi_tcq.h>
......
#ifndef TARGET_CORE_UA_H #ifndef TARGET_CORE_UA_H
#define TARGET_CORE_UA_H #define TARGET_CORE_UA_H
#include <target/target_core_base.h>
/* /*
* From spc4r17, Table D.1: ASC and ASCQ Assignement * From spc4r17, Table D.1: ASC and ASCQ Assignement
*/ */
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/uio_driver.h> #include <linux/uio_driver.h>
#include <linux/stringify.h> #include <linux/stringify.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/highmem.h>
#include <net/genetlink.h> #include <net/genetlink.h>
#include <scsi/scsi_common.h> #include <scsi/scsi_common.h>
#include <scsi/scsi_proto.h> #include <scsi/scsi_proto.h>
...@@ -537,7 +538,7 @@ tcmu_queue_cmd(struct se_cmd *se_cmd) ...@@ -537,7 +538,7 @@ tcmu_queue_cmd(struct se_cmd *se_cmd)
struct se_device *se_dev = se_cmd->se_dev; struct se_device *se_dev = se_cmd->se_dev;
struct tcmu_dev *udev = TCMU_DEV(se_dev); struct tcmu_dev *udev = TCMU_DEV(se_dev);
struct tcmu_cmd *tcmu_cmd; struct tcmu_cmd *tcmu_cmd;
int ret; sense_reason_t ret;
tcmu_cmd = tcmu_alloc_cmd(se_cmd); tcmu_cmd = tcmu_alloc_cmd(se_cmd);
if (!tcmu_cmd) if (!tcmu_cmd)
...@@ -685,8 +686,6 @@ static int tcmu_check_expired_cmd(int id, void *p, void *data) ...@@ -685,8 +686,6 @@ static int tcmu_check_expired_cmd(int id, void *p, void *data)
target_complete_cmd(cmd->se_cmd, SAM_STAT_CHECK_CONDITION); target_complete_cmd(cmd->se_cmd, SAM_STAT_CHECK_CONDITION);
cmd->se_cmd = NULL; cmd->se_cmd = NULL;
kmem_cache_free(tcmu_cmd_cache, cmd);
return 0; return 0;
} }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/configfs.h> #include <linux/configfs.h>
#include <linux/ratelimit.h>
#include <scsi/scsi_proto.h> #include <scsi/scsi_proto.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
......
#include <target/target_core_base.h>
#define XCOPY_TARGET_DESC_LEN 32 #define XCOPY_TARGET_DESC_LEN 32
#define XCOPY_SEGMENT_DESC_LEN 28 #define XCOPY_SEGMENT_DESC_LEN 28
#define XCOPY_NAA_IEEE_REGEX_LEN 16 #define XCOPY_NAA_IEEE_REGEX_LEN 16
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
#ifndef __TCM_FC_H__ #ifndef __TCM_FC_H__
#define __TCM_FC_H__ #define __TCM_FC_H__
#include <linux/types.h>
#include <target/target_core_base.h>
#define FT_VERSION "0.4" #define FT_VERSION "0.4"
#define FT_NAMELEN 32 /* length of ASCII WWPNs including pad */ #define FT_NAMELEN 32 /* length of ASCII WWPNs including pad */
......
...@@ -1073,7 +1073,7 @@ static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu, ...@@ -1073,7 +1073,7 @@ static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu,
struct usbg_cmd *cmd; struct usbg_cmd *cmd;
int tag; 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) if (tag < 0)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
...@@ -35,14 +35,11 @@ ...@@ -35,14 +35,11 @@
#ifndef _CONFIGFS_H_ #ifndef _CONFIGFS_H_
#define _CONFIGFS_H_ #define _CONFIGFS_H_
#include <linux/kernel.h> #include <linux/stat.h> /* S_IRUGO */
#include <linux/types.h> #include <linux/types.h> /* ssize_t */
#include <linux/list.h> #include <linux/list.h> /* struct list_head */
#include <linux/kref.h> #include <linux/kref.h> /* struct kref */
#include <linux/mutex.h> #include <linux/mutex.h> /* struct mutex */
#include <linux/err.h>
#include <linux/atomic.h>
#define CONFIGFS_ITEM_NAME_LEN 20 #define CONFIGFS_ITEM_NAME_LEN 20
......
#ifndef ISCSI_TARGET_CORE_H #ifndef ISCSI_TARGET_CORE_H
#define ISCSI_TARGET_CORE_H #define ISCSI_TARGET_CORE_H
#include <linux/in.h> #include <linux/dma-direction.h> /* enum dma_data_direction */
#include <linux/configfs.h> #include <linux/list.h> /* struct list_head */
#include <net/sock.h> #include <linux/socket.h> /* struct sockaddr_storage */
#include <net/tcp.h> #include <linux/types.h> /* u8 */
#include <scsi/iscsi_proto.h> #include <scsi/iscsi_proto.h> /* itt_t */
#include <target/target_core_base.h> #include <target/target_core_base.h> /* struct se_cmd */
struct sock;
#define ISCSIT_VERSION "v4.1.0" #define ISCSIT_VERSION "v4.1.0"
#define ISCSI_MAX_DATASN_MISSING_COUNT 16 #define ISCSI_MAX_DATASN_MISSING_COUNT 16
......
#ifndef ISCSI_TARGET_STAT_H #ifndef ISCSI_TARGET_STAT_H
#define ISCSI_TARGET_STAT_H #define ISCSI_TARGET_STAT_H
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/socket.h>
/* /*
* For struct iscsi_tiqn->tiqn_wwn default groups * For struct iscsi_tiqn->tiqn_wwn default groups
*/ */
......
#include <linux/module.h> #include "iscsi_target_core.h" /* struct iscsi_cmd */
#include <linux/list.h>
#include "iscsi_target_core.h" struct sockaddr_storage;
struct iscsit_transport { struct iscsit_transport {
#define ISCSIT_TRANSPORT_NAME 16 #define ISCSIT_TRANSPORT_NAME 16
......
#ifndef TARGET_CORE_BACKEND_H #ifndef TARGET_CORE_BACKEND_H
#define TARGET_CORE_BACKEND_H #define TARGET_CORE_BACKEND_H
#include <linux/types.h>
#include <target/target_core_base.h>
#define TRANSPORT_FLAG_PASSTHROUGH 1 #define TRANSPORT_FLAG_PASSTHROUGH 1
struct request_queue;
struct scatterlist;
struct target_backend_ops { struct target_backend_ops {
char name[16]; char name[16];
char inquiry_prod[16]; char inquiry_prod[16];
......
#ifndef TARGET_CORE_BASE_H #ifndef TARGET_CORE_BASE_H
#define TARGET_CORE_BASE_H #define TARGET_CORE_BASE_H
#include <linux/in.h> #include <linux/configfs.h> /* struct config_group */
#include <linux/configfs.h> #include <linux/dma-direction.h> /* enum dma_data_direction */
#include <linux/dma-mapping.h> #include <linux/percpu_ida.h> /* struct percpu_ida */
#include <linux/blkdev.h> #include <linux/semaphore.h> /* struct semaphore */
#include <linux/percpu_ida.h>
#include <linux/t10-pi.h>
#include <net/sock.h>
#include <net/tcp.h>
#define TARGET_CORE_VERSION "v5.0" #define TARGET_CORE_VERSION "v5.0"
......
#ifndef TARGET_CORE_FABRIC_H #ifndef TARGET_CORE_FABRIC_H
#define TARGET_CORE_FABRIC_H #define TARGET_CORE_FABRIC_H
#include <linux/configfs.h>
#include <linux/types.h>
#include <target/target_core_base.h>
struct target_core_fabric_ops { struct target_core_fabric_ops {
struct module *module; struct module *module;
const char *name; const char *name;
......
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