Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb43bd08 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull scsi target fixes from Nicholas Bellinger:
 "Mostly minor fixes this time, including:

   - Add missing virtio-scsi -> TCM attribute conversion in vhost-scsi.
   - Fix persistent reservations write exclusive handling to allow
     readers for all registered I_T nexuses.
   - Drop arbitrary maximum I/O size limit in order to process I/Os
     larger than 4 MB, required for initiators that don't honor block
     limits EVPD.
   - Drop the now left-over fabric_max_sectors attribute"

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  iscsi-target: Fix typos in enum cmd_flags_table
  MAINTAINERS: Add entry for iSER target driver
  target: Allow Write Exclusive non-reservation holders to READ
  target: Drop left-over fabric_max_sectors attribute
  target: Drop arbitrary maximum I/O size limit
  Documentation/target: Update fabric_ops to latest code
  vhost-scsi: Add missing virtio-scsi -> TCM attribute conversion
parents 721c21c1 8060b8dd
Loading
Loading
Loading
Loading
+12 −37
Original line number Diff line number Diff line
@@ -389,9 +389,6 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
	buf += "	.release_cmd			= " + fabric_mod_name + "_release_cmd,\n"
	buf += "	.shutdown_session		= " + fabric_mod_name + "_shutdown_session,\n"
	buf += "	.close_session			= " + fabric_mod_name + "_close_session,\n"
	buf += "	.stop_session			= " + fabric_mod_name + "_stop_session,\n"
	buf += "	.fall_back_to_erl0		= " + fabric_mod_name + "_reset_nexus,\n"
	buf += "	.sess_logged_in			= " + fabric_mod_name + "_sess_logged_in,\n"
	buf += "	.sess_get_index			= " + fabric_mod_name + "_sess_get_index,\n"
	buf += "	.sess_get_initiator_sid		= NULL,\n"
	buf += "	.write_pending			= " + fabric_mod_name + "_write_pending,\n"
@@ -402,7 +399,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
	buf += "	.queue_data_in			= " + fabric_mod_name + "_queue_data_in,\n"
	buf += "	.queue_status			= " + fabric_mod_name + "_queue_status,\n"
	buf += "	.queue_tm_rsp			= " + fabric_mod_name + "_queue_tm_rsp,\n"
	buf += "	.is_state_remove		= " + fabric_mod_name + "_is_state_remove,\n"
	buf += "	.aborted_task			= " + fabric_mod_name + "_aborted_task,\n"
	buf += "	/*\n"
	buf += "	 * Setup function pointers for generic logic in target_core_fabric_configfs.c\n"
	buf += "	 */\n"
@@ -428,7 +425,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
	buf += "	/*\n"
	buf += "	 * Register the top level struct config_item_type with TCM core\n"
	buf += "	 */\n"
	buf += "	fabric = target_fabric_configfs_init(THIS_MODULE, \"" + fabric_mod_name[4:] + "\");\n"
	buf += "	fabric = target_fabric_configfs_init(THIS_MODULE, \"" + fabric_mod_name + "\");\n"
	buf += "	if (IS_ERR(fabric)) {\n"
	buf += "		printk(KERN_ERR \"target_fabric_configfs_init() failed\\n\");\n"
	buf += "		return PTR_ERR(fabric);\n"
@@ -595,7 +592,7 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
		if re.search('get_fabric_name', fo):
			buf += "char *" + fabric_mod_name + "_get_fabric_name(void)\n"
			buf += "{\n"
			buf += "	return \"" + fabric_mod_name[4:] + "\";\n"
			buf += "	return \"" + fabric_mod_name + "\";\n"
			buf += "}\n\n"
			bufi += "char *" + fabric_mod_name + "_get_fabric_name(void);\n"
			continue
@@ -820,27 +817,6 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
			buf += "}\n\n"
			bufi += "void " + fabric_mod_name + "_close_session(struct se_session *);\n"

		if re.search('stop_session\)\(', fo):
			buf += "void " + fabric_mod_name + "_stop_session(struct se_session *se_sess, int sess_sleep , int conn_sleep)\n"
			buf += "{\n"
			buf += "	return;\n"
			buf += "}\n\n"
			bufi += "void " + fabric_mod_name + "_stop_session(struct se_session *, int, int);\n"

		if re.search('fall_back_to_erl0\)\(', fo):
			buf += "void " + fabric_mod_name + "_reset_nexus(struct se_session *se_sess)\n"
			buf += "{\n"
			buf += "	return;\n"
			buf += "}\n\n"
			bufi += "void " + fabric_mod_name + "_reset_nexus(struct se_session *);\n"

		if re.search('sess_logged_in\)\(', fo):
			buf += "int " + fabric_mod_name + "_sess_logged_in(struct se_session *se_sess)\n"
			buf += "{\n"
			buf += "	return 0;\n"
			buf += "}\n\n"
			bufi += "int " + fabric_mod_name + "_sess_logged_in(struct se_session *);\n"

		if re.search('sess_get_index\)\(', fo):
			buf += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *se_sess)\n"
			buf += "{\n"
@@ -898,19 +874,18 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
			bufi += "int " + fabric_mod_name + "_queue_status(struct se_cmd *);\n"

		if re.search('queue_tm_rsp\)\(', fo):
			buf += "int " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *se_cmd)\n"
			buf += "void " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *se_cmd)\n"
			buf += "{\n"
			buf += "	return 0;\n"
			buf += "	return;\n"
			buf += "}\n\n"
			bufi += "int " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *);\n"
			bufi += "void " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *);\n"

		if re.search('is_state_remove\)\(', fo):
			buf += "int " + fabric_mod_name + "_is_state_remove(struct se_cmd *se_cmd)\n"
		if re.search('aborted_task\)\(', fo):
			buf += "void " + fabric_mod_name + "_aborted_task(struct se_cmd *se_cmd)\n"
			buf += "{\n"
			buf += "	return 0;\n"
			buf += "	return;\n"
			buf += "}\n\n"
			bufi += "int " + fabric_mod_name + "_is_state_remove(struct se_cmd *);\n"

			bufi += "void " + fabric_mod_name + "_aborted_task(struct se_cmd *);\n"

	ret = p.write(buf)
	if ret:
+9 −0
Original line number Diff line number Diff line
@@ -5280,6 +5280,15 @@ W: www.open-iscsi.org
Q:	http://patchwork.kernel.org/project/linux-rdma/list/
F:	drivers/infiniband/ulp/iser/

ISCSI EXTENSIONS FOR RDMA (ISER) TARGET
M:	Sagi Grimberg <sagig@mellanox.com>
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master
L:	linux-rdma@vger.kernel.org
L:	target-devel@vger.kernel.org
S:	Supported
W:	http://www.linux-iscsi.org
F:	drivers/infiniband/ulp/isert

ISDN SUBSYSTEM
M:	Karsten Keil <isdn@linux-pingi.de>
L:	isdn4linux@listserv.isdn4linux.de (subscribers-only)
+6 −6
Original line number Diff line number Diff line
@@ -2027,10 +2027,10 @@ iscsit_process_text_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
		goto reject;
	}
	if (!strncmp("=All", text_ptr, 4)) {
		cmd->cmd_flags |= IFC_SENDTARGETS_ALL;
		cmd->cmd_flags |= ICF_SENDTARGETS_ALL;
	} else if (!strncmp("=iqn.", text_ptr, 5) ||
		   !strncmp("=eui.", text_ptr, 5)) {
		cmd->cmd_flags |= IFC_SENDTARGETS_SINGLE;
		cmd->cmd_flags |= ICF_SENDTARGETS_SINGLE;
	} else {
		pr_err("Unable to locate valid SendTargets=%s value\n", text_ptr);
		goto reject;
@@ -3415,10 +3415,10 @@ iscsit_build_sendtargets_response(struct iscsi_cmd *cmd,
		return -ENOMEM;
	}
	/*
	 * Locate pointer to iqn./eui. string for IFC_SENDTARGETS_SINGLE
	 * Locate pointer to iqn./eui. string for ICF_SENDTARGETS_SINGLE
	 * explicit case..
	 */
	if (cmd->cmd_flags & IFC_SENDTARGETS_SINGLE) {
	if (cmd->cmd_flags & ICF_SENDTARGETS_SINGLE) {
		text_ptr = strchr(text_in, '=');
		if (!text_ptr) {
			pr_err("Unable to locate '=' string in text_in:"
@@ -3434,7 +3434,7 @@ iscsit_build_sendtargets_response(struct iscsi_cmd *cmd,

	spin_lock(&tiqn_lock);
	list_for_each_entry(tiqn, &g_tiqn_list, tiqn_list) {
		if ((cmd->cmd_flags & IFC_SENDTARGETS_SINGLE) &&
		if ((cmd->cmd_flags & ICF_SENDTARGETS_SINGLE) &&
		     strcmp(tiqn->tiqn, text_ptr)) {
			continue;
		}
@@ -3512,7 +3512,7 @@ iscsit_build_sendtargets_response(struct iscsi_cmd *cmd,
		if (end_of_buf)
			break;

		if (cmd->cmd_flags & IFC_SENDTARGETS_SINGLE)
		if (cmd->cmd_flags & ICF_SENDTARGETS_SINGLE)
			break;
	}
	spin_unlock(&tiqn_lock);
+2 −2
Original line number Diff line number Diff line
@@ -135,8 +135,8 @@ enum cmd_flags_table {
	ICF_CONTIG_MEMORY			= 0x00000020,
	ICF_ATTACHED_TO_RQUEUE			= 0x00000040,
	ICF_OOO_CMDSN				= 0x00000080,
	IFC_SENDTARGETS_ALL			= 0x00000100,
	IFC_SENDTARGETS_SINGLE			= 0x00000200,
	ICF_SENDTARGETS_ALL			= 0x00000100,
	ICF_SENDTARGETS_SINGLE			= 0x00000200,
};

/* struct iscsi_cmd->i_state */
+4 −50
Original line number Diff line number Diff line
@@ -1103,51 +1103,6 @@ int se_dev_set_queue_depth(struct se_device *dev, u32 queue_depth)
}
EXPORT_SYMBOL(se_dev_set_queue_depth);

int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors)
{
	int block_size = dev->dev_attrib.block_size;

	if (dev->export_count) {
		pr_err("dev[%p]: Unable to change SE Device"
			" fabric_max_sectors while export_count is %d\n",
			dev, dev->export_count);
		return -EINVAL;
	}
	if (!fabric_max_sectors) {
		pr_err("dev[%p]: Illegal ZERO value for"
			" fabric_max_sectors\n", dev);
		return -EINVAL;
	}
	if (fabric_max_sectors < DA_STATUS_MAX_SECTORS_MIN) {
		pr_err("dev[%p]: Passed fabric_max_sectors: %u less than"
			" DA_STATUS_MAX_SECTORS_MIN: %u\n", dev, fabric_max_sectors,
				DA_STATUS_MAX_SECTORS_MIN);
		return -EINVAL;
	}
	if (fabric_max_sectors > DA_STATUS_MAX_SECTORS_MAX) {
		pr_err("dev[%p]: Passed fabric_max_sectors: %u"
			" greater than DA_STATUS_MAX_SECTORS_MAX:"
			" %u\n", dev, fabric_max_sectors,
			DA_STATUS_MAX_SECTORS_MAX);
		return -EINVAL;
	}
	/*
	 * Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks()
	 */
	if (!block_size) {
		block_size = 512;
		pr_warn("Defaulting to 512 for zero block_size\n");
	}
	fabric_max_sectors = se_dev_align_max_sectors(fabric_max_sectors,
						      block_size);

	dev->dev_attrib.fabric_max_sectors = fabric_max_sectors;
	pr_debug("dev[%p]: SE Device max_sectors changed to %u\n",
			dev, fabric_max_sectors);
	return 0;
}
EXPORT_SYMBOL(se_dev_set_fabric_max_sectors);

int se_dev_set_optimal_sectors(struct se_device *dev, u32 optimal_sectors)
{
	if (dev->export_count) {
@@ -1156,10 +1111,10 @@ int se_dev_set_optimal_sectors(struct se_device *dev, u32 optimal_sectors)
			dev, dev->export_count);
		return -EINVAL;
	}
	if (optimal_sectors > dev->dev_attrib.fabric_max_sectors) {
	if (optimal_sectors > dev->dev_attrib.hw_max_sectors) {
		pr_err("dev[%p]: Passed optimal_sectors %u cannot be"
			" greater than fabric_max_sectors: %u\n", dev,
			optimal_sectors, dev->dev_attrib.fabric_max_sectors);
			" greater than hw_max_sectors: %u\n", dev,
			optimal_sectors, dev->dev_attrib.hw_max_sectors);
		return -EINVAL;
	}

@@ -1553,8 +1508,6 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
	dev->dev_attrib.unmap_granularity_alignment =
				DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT;
	dev->dev_attrib.max_write_same_len = DA_MAX_WRITE_SAME_LEN;
	dev->dev_attrib.fabric_max_sectors = DA_FABRIC_MAX_SECTORS;
	dev->dev_attrib.optimal_sectors = DA_FABRIC_MAX_SECTORS;

	xcopy_lun = &dev->xcopy_lun;
	xcopy_lun->lun_se_dev = dev;
@@ -1595,6 +1548,7 @@ int target_configure_device(struct se_device *dev)
	dev->dev_attrib.hw_max_sectors =
		se_dev_align_max_sectors(dev->dev_attrib.hw_max_sectors,
					 dev->dev_attrib.hw_block_size);
	dev->dev_attrib.optimal_sectors = dev->dev_attrib.hw_max_sectors;

	dev->dev_index = scsi_get_new_index(SCSI_DEVICE_INDEX);
	dev->creation_time = get_jiffies_64();
Loading