Browse Source

Work around a bug in the OpenSolaris iSCSI target.

We didn't specify values for MaxRecvDataSegmentLength and
MaxBurstLength (to save space, since we were happy with the
RFC-defined default values of 8kB and 256kB respectively).  However,
the OpenSolaris target (incorrectly) assumes default values of zero
for these parameters.

The upshot was that the OpenSolaris target would get stuck in an
endless loop trying to send us the first 512-byte sector, zero bytes
at a time, and would eventually run out of memory and core-dump.

Fixed by explicitly specifying the default values for these two
parameters.
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
c194b0c4bf
1 changed files with 10 additions and 3 deletions
  1. 10
    3
      src/net/tcp/iscsi.c

+ 10
- 3
src/net/tcp/iscsi.c View File

421
  *     MaxConnections is irrelevant; we make only one connection anyway
421
  *     MaxConnections is irrelevant; we make only one connection anyway
422
  *     InitialR2T=Yes [1]
422
  *     InitialR2T=Yes [1]
423
  *     ImmediateData is irrelevant; we never send immediate data
423
  *     ImmediateData is irrelevant; we never send immediate data
424
- *     MaxRecvDataSegmentLength=8192 (default; we don't care)
425
- *     MaxBurstLength=262144 (default; we don't care)
424
+ *     MaxRecvDataSegmentLength=8192 (default; we don't care) [3]
425
+ *     MaxBurstLength=262144 (default; we don't care) [3]
426
  *     FirstBurstLength=262144 (default; we don't care)
426
  *     FirstBurstLength=262144 (default; we don't care)
427
  *     DefaultTime2Wait=0 [2]
427
  *     DefaultTime2Wait=0 [2]
428
  *     DefaultTime2Retain=0 [2]
428
  *     DefaultTime2Retain=0 [2]
438
  * [2] These ensure that we can safely start a new task once we have
438
  * [2] These ensure that we can safely start a new task once we have
439
  * reconnected after a failure, without having to manually tidy up
439
  * reconnected after a failure, without having to manually tidy up
440
  * after the old one.
440
  * after the old one.
441
+ *
442
+ * [3] We are quite happy to use the RFC-defined default values for
443
+ * these parameters, but some targets (notably OpenSolaris)
444
+ * incorrectly assume a default value of zero, so we explicitly
445
+ * specify the default values.
441
  */
446
  */
442
 static int iscsi_build_login_request_strings ( struct iscsi_session *iscsi,
447
 static int iscsi_build_login_request_strings ( struct iscsi_session *iscsi,
443
 					       void *data, size_t len ) {
448
 					       void *data, size_t len ) {
475
 				    "HeaderDigest=None%c"
480
 				    "HeaderDigest=None%c"
476
 				    "DataDigest=None%c"
481
 				    "DataDigest=None%c"
477
 				    "InitialR2T=Yes%c"
482
 				    "InitialR2T=Yes%c"
483
+				    "MaxRecvDataSegmentLength=8192%c"
484
+				    "MaxBurstLength=262144%c"
478
 				    "DefaultTime2Wait=0%c"
485
 				    "DefaultTime2Wait=0%c"
479
 				    "DefaultTime2Retain=0%c"
486
 				    "DefaultTime2Retain=0%c"
480
 				    "MaxOutstandingR2T=1%c"
487
 				    "MaxOutstandingR2T=1%c"
481
 				    "DataPDUInOrder=Yes%c"
488
 				    "DataPDUInOrder=Yes%c"
482
 				    "DataSequenceInOrder=Yes%c"
489
 				    "DataSequenceInOrder=Yes%c"
483
 				    "ErrorRecoveryLevel=0%c",
490
 				    "ErrorRecoveryLevel=0%c",
484
-				    0, 0, 0, 0, 0, 0, 0, 0, 0 );
491
+				    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
485
 	}
492
 	}
486
 
493
 
487
 	return used;
494
 	return used;

Loading…
Cancel
Save