Commit 2d1fc3ca authored by Changpeng Liu's avatar Changpeng Liu Committed by Tomasz Zawadzki
Browse files

iscsi: report that long text responses isn't supported



When there are many Target information which exceeds the data
buffer, the initiator and target can use long text responses,
but SPDK doesn't support this feature now, so here we just
report an error here, we may add this feature in following
patches.

Fix issue #1442.

Change-Id: I5962c00943819cd11ce21e610e4b37265451f0cb
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3454


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarZiye Yang <ziye.yang@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 1da44e06
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -319,17 +319,12 @@ iscsi_send_tgts(struct spdk_iscsi_conn *conn, const char *iiqn,
	if (alloc_len < 1) {
		return 0;
	}
	if (total > alloc_len) {
	if (total >= alloc_len) {
		total = alloc_len;
		data[total - 1] = '\0';
		return total;
	}

	if (alloc_len - total < 1) {
		SPDK_ERRLOG("data space small %d\n", alloc_len);
		return total;
	}

	pthread_mutex_lock(&g_iscsi.mutex);
	TAILQ_FOREACH(target, &g_iscsi.target_head, tailq) {
		if (strcasecmp(tiqn, "ALL") != 0
@@ -352,8 +347,11 @@ iscsi_send_tgts(struct spdk_iscsi_conn *conn, const char *iiqn,
			TAILQ_FOREACH(p, &pg->head, per_pg_tailq) {
				if (alloc_len - total < 1) {
					pthread_mutex_unlock(&g_iscsi.mutex);
					SPDK_ERRLOG("data space small %d\n", alloc_len);
					return total;
					/* TODO: long text responses support */
					SPDK_ERRLOG("SPDK doesn't support long text responses now, "
						    "you can use larger MaxRecvDataSegmentLength"
						    "value in initiator\n");
					return alloc_len;
				}
				host = p->host;
				/* wildcard? */