[iSCSI] Produce meaningful errors on login failure

Return the most appropriate of EACCES, EPERM, ENODEV, ENOTSUP, EIO or
EINVAL depending on the exact error returned by the target, rather than
just always returning EPERM.

Also, ensure that error strings exist for these errors.
This commit is contained in:
Michael Brown
2008-06-03 23:46:36 +01:00
parent c899bdc5a8
commit 75965c9c6e
3 changed files with 53 additions and 15 deletions

View File

@@ -224,10 +224,14 @@ struct iscsi_bhs_login_response {
#define ISCSI_OPCODE_LOGIN_RESPONSE 0x23
/* Login response status codes */
#define ISCSI_STATUS_SUCCESS 0x00
#define ISCSI_STATUS_REDIRECT 0x01
#define ISCSI_STATUS_INITIATOR_ERROR 0x02
#define ISCSI_STATUS_TARGET_ERROR 0x03
#define ISCSI_STATUS_SUCCESS 0x00
#define ISCSI_STATUS_REDIRECT 0x01
#define ISCSI_STATUS_INITIATOR_ERROR 0x02
#define ISCSI_STATUS_INITIATOR_ERROR_AUTHENTICATION 0x01
#define ISCSI_STATUS_INITIATOR_ERROR_AUTHORISATION 0x02
#define ISCSI_STATUS_INITIATOR_ERROR_NOT_FOUND 0x03
#define ISCSI_STATUS_INITIATOR_ERROR_REMOVED 0x04
#define ISCSI_STATUS_TARGET_ERROR 0x03
/**
* iSCSI SCSI command basic header segment