fix error handling for unsupported commands

- Respond with failure for unsupported task management commands
- Increase MaxRecvDataSegmentLength to 65536, to match FirstBurstLength

Signed-off-by: Utkarsh Mani Tripathi <utkarsh.tripathi@mayadata.io>
This commit is contained in:
Utkarsh Mani Tripathi
2019-11-18 18:20:59 +05:30
parent 64deda8106
commit 1b02c7897e
3 changed files with 2 additions and 4 deletions

View File

@@ -841,10 +841,8 @@ func (s *ISCSITargetDriver) iscsiExecTask(task *iscsiTask) error {
fallthrough
case ISCSI_TM_FUNC_TARGET_WARM_RESET, ISCSI_TM_FUNC_TARGET_COLD_RESET, ISCSI_TM_FUNC_TASK_REASSIGN:
task.result = ISCSI_TMF_RSP_NOT_SUPPORTED
return fmt.Errorf("The task function is not supported")
default:
task.result = ISCSI_TMF_RSP_REJECTED
return fmt.Errorf("Unknown task function")
}
// return response to initiator
return task.conn.buildRespPackage(OpSCSITaskResp, task)