mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 10:37:23 +01:00
32f378f1f7ab282ea094887c5690058eb5c26c80
core/frontend/iscsi/login.go
Minimal T2-scope login negotiator — accepts any Login-Request
with Transit=true + NSG=FullFeature and responds with Success.
No text-parameter negotiation, no CHAP, no digest. Sufficient
for L1 in-process component route; OS-initiator compat
(MaxRecv, digests, CHAP) is L2-OS scope.
core/frontend/iscsi/session.go
One goroutine per TCP connection. Serial rx/tx (no txLoop
split): login phase → full-feature dispatch. SCSI-Cmd PDUs
carry immediate data for WRITE (ImmediateData=true); READ
responses ride in a single Data-In with the S-bit set so the
status conveys with the data. CHECK CONDITION responses put
fixed-format sense data in the SCSI-Response data segment.
Logout + NOP-Out handled; other opcodes rejected.
core/frontend/iscsi/target.go
TCP listener + accept loop. On each accept, calls
frontend.Provider.Open to get the session's backend, then
builds an SCSIHandler bound to that backend. Close drains
active sessions.
core/frontend/iscsi/client_support_test.go (sw test-support)
Tiny Go initiator used by the L1 route tests: dialAndLogin,
scsiCmd (WRITE/READ/metadata), logout. Covers exactly what
L1 needs — not a general initiator.
core/frontend/iscsi/t2_route_iscsi_test.go (QA-owned, test-spec §5)
T2.L1.i1 TestT2Route_ISCSI_AttachWriteRead_Component:
in-process target + RecordingBackend — WRITE(10) routes
payload to backend exactly once; READ(10) returns the same
bytes over real TCP+PDU framing.
T2.L1.i2 TestT2Route_ISCSI_EndpointVersionMove_RejectsOldWrite:
swap provider to StaleRejectingBackend mid-flight; re-login
session's WRITE returns CHECK CONDITION, never success.
T2.L1.i3 TestT2Route_ISCSI_EndpointVersionMove_RejectsOldRead:
populate backend with known "secret" bytes, swap to stale,
re-login + READ — stale path returns CHECK CONDITION AND
bytes do NOT leak to initiator.
Tests green:
core/frontend/iscsi: 29 tests (errors 4 + guard 1 + scsi 11 +
pdu 10 + L1 route 3)
core/frontend, memback, testback, host/volume: unchanged.
Remaining for T2-closed: cmd/blockvolume --iscsi-* wiring, L2-harness,
NVMe/TCP symmetric slice, L2-OS enablement on m01.
Languages
Go
84.7%
Rust
7.7%
Shell
2.7%
templ
1.5%
Java
1%
Other
2.1%