Page MenuHomeFreeBSD

D32650.id97440.diff
No OneTemporary

D32650.id97440.diff

Index: sys/dev/iscsi/iscsi.c
===================================================================
--- sys/dev/iscsi/iscsi.c
+++ sys/dev/iscsi/iscsi.c
@@ -892,15 +892,39 @@
}
ccb = io->io_ccb;
- if (ntohl(bhssr->bhssr_expdatasn) != io->io_datasn) {
- ISCSI_SESSION_WARN(is,
- "ExpDataSN mismatch in SCSI Response (%u vs %u)",
- ntohl(bhssr->bhssr_expdatasn), io->io_datasn);
- icl_pdu_free(response);
- iscsi_session_reconnect(is);
- ISCSI_SESSION_UNLOCK(is);
- return;
+ if (bhssr->bhssr_response == BHSSR_RESPONSE_COMMAND_COMPLETED) {
+ if (ntohl(bhssr->bhssr_expdatasn) != io->io_datasn) {
+ ISCSI_SESSION_WARN(is,
+ "ExpDataSN mismatch in SCSI Response (%u vs %u)",
+ ntohl(bhssr->bhssr_expdatasn), io->io_datasn);
+
+ /*
+ * XXX: Permit an ExpDataSN of zero for errors.
+ *
+ * This doesn't conform to RFC 7143, but some
+ * targets seem to do this.
+ */
+ if (bhssr->bhssr_status != 0 &&
+ bhssr->bhssr_expdatasn == htonl(0))
+ goto skip_expdatasn;
+
+ icl_pdu_free(response);
+ iscsi_session_reconnect(is);
+ ISCSI_SESSION_UNLOCK(is);
+ return;
+ }
+ } else {
+ if (bhssr->bhssr_expdatasn != htonl(0)) {
+ ISCSI_SESSION_WARN(is,
+ "ExpDataSN mismatch in SCSI Response (%u vs 0)",
+ ntohl(bhssr->bhssr_expdatasn));
+ icl_pdu_free(response);
+ iscsi_session_reconnect(is);
+ ISCSI_SESSION_UNLOCK(is);
+ return;
+ }
}
+skip_expdatasn:
/*
* With iSER, after getting good response we can be sure

File Metadata

Mime Type
text/plain
Expires
Fri, May 22, 12:58 AM (11 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33411649
Default Alt Text
D32650.id97440.diff (1 KB)

Event Timeline