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: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3454 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ziye Yang <ziye.yang@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
1da44e0604
commit
2d1fc3ca06
@ -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? */
|
||||
|
Loading…
Reference in New Issue
Block a user