Commit Graph

23 Commits

Author SHA1 Message Date
Lei Xue
8ffe5ec5ce fix: prevent nil deref on session reinstatement during cleanup race
When a new login arrives while the previous connection's async cleanup
is still running, LookupISCSISession finds the stale session but
LookupConnection returns nil (old connection already closed). This
caused a nil pointer dereference when accessing existConn.session
during session reinstatement.

Fix by checking existConn != nil before reinstatement. If the old
connection is already gone, unbind the stale session and create
a fresh one instead.

Also add sync.Once to removeConnectionFromSession to prevent
concurrent goroutine and main-path cleanup from racing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 14:37:16 +08:00
Lei Xue
16108ced95 optimize performance: reduce allocations, buffered I/O, and zero-copy reads
- Read path: eliminate redundant allocation in bsPerformCommand - remove
  the pre-allocation before bs.Read() and the append loop for zero-fill,
  use direct copy and in-place zero-fill instead
- parseHeader: use command pool (getCommand) instead of direct allocation,
  reducing GC pressure on the hot path
- Unmap: use a shared 1MB zero buffer instead of allocating per-descriptor,
  dramatically reducing allocations for large unmap operations
- Network I/O: add 256KB bufio.Writer to iSCSI connections, batching
  small PDU writes into fewer syscalls. Flush after txHandler completes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 19:03:30 +08:00
Lei Xue
00cfac3d24 optimize the perf and support more features 2026-03-14 11:45:35 +08:00
Chris Koch
6af024c2e3 iscsit: support AuthMethod=None security negotiation
Signed-off-by: Chris Koch <chrisko@google.com>
2020-01-21 22:45:18 -08:00
Utkarsh Mani Tripathi
d7891b1f68 Implement stats and resize and fix remote backing store apis
- Convert constant to var so that it can be configured from backend
- Add options to disable persistent reservation and ORWrite16 commands

Signed-off-by: Utkarsh Mani Tripathi <utkarsh.tripathi@mayadata.io>
2019-11-20 14:34:35 +05:30
Utkarsh Mani Tripathi
64deda8106 convert initialR2T to always true for datadigest
tttttt-off-by: Utkarsh Mani Tripathi <utkarsh.tripathi@mayadata.io>
2019-11-18 18:10:53 +05:30
Lei Xue
787d872a30 perf3 2017-08-02 19:44:13 +08:00
Lei Xue
fcb96b323d perf2 2017-08-02 19:01:41 +08:00
Lei Xue
4ae643e9f8 perf 2017-07-31 21:47:38 +08:00
Lei Xue
eeb30723c8 fix bugs 2017-07-09 09:33:34 +08:00
Lei Xue
8ce8ade3d4 update ModeSense6 function 2017-07-05 21:23:13 +08:00
Lei Xue
3eb2654e52 Merge pull request #52 from carmark/task
support iscsi task function
2017-06-21 15:30:43 +08:00
Lei Xue
12a648b5f3 fix sense data issue 2017-06-15 08:16:43 +08:00
Lei Xue
7a2b08ff80 support iscsi task function 2017-06-12 21:06:57 +08:00
Payes Anand
0b629a16fe Sending data in dataIn PDUs splitted by maxRecvDataSegment Length 2017-03-12 02:00:30 +05:30
payes
ddf59bf1cb Making sure the required number of bytes are read 2017-02-17 18:55:27 +05:30
Lei Xue
42949563ac small refactor: combine all package response generation 2016-12-11 18:21:53 +08:00
Le Zhang
bb67ec66c7 login negotiation and session/conn reinstatment 2016-12-03 04:23:08 +08:00
Le Zhang
82e6d230a2 PR implementation 2016-11-24 23:16:53 +08:00
Le Zhang
547faf684d iSCSI/SCSI multi port/ALUA support
fix ALUA flag issue
fix NNA flag issue
fix fixed format sense data builder issue
2016-10-18 16:59:25 +08:00
Lei Xue
3fc1973593 date: 2016-09-11/21:30 2016-09-11 21:35:17 +08:00
Lei Xue
11aad6c253 date: 2016-08-30/22:00 2016-08-30 22:07:32 +08:00
Lei Xue
aedc09021f fix bugs and make it run basically 2016-08-27 20:07:51 +08:00