From 1594cf98926ceef1de36010335f9ca19cc050bad Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 31 Oct 2009 10:33:00 -0400 Subject: [PATCH] Windows: Use STATUS_IO_TIMEOUT where STATUS_TIMEOUT was returned STATUS_TIMEOUT causes the smb redirector to drop the connection. STATUS_RETRY is interpreted by the smb redirector as if the error was generated by the transport stack and not the smb server. STATUS_IO_TIMEOUT is listed in the SNIA CIFS 1.0 spec as a valid return code for the smb server. Lets us that. LICENSE MIT Change-Id: I842a78cde3d975c88bbeb64294dd53cc8b101047 Reviewed-on: http://gerrit.openafs.org/831 Reviewed-by: Derrick Brashear Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman --- src/WINNT/afsd/smb.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index 21dd0e3..48c2063 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -3011,12 +3011,20 @@ void smb_MapNTError(long code, unsigned long *NTStatusp) /* Do not send Timeout to the SMB redirector. * It causes the redirector to drop the connection */ NTStatus = 0x00000102L; /* Timeout */ -#else + /* do not send Retry to the SMB redirector. + * It believes the error comes from the transport + * layer not from the SMB server. */ NTStatus = 0xC000022DL; /* Retry */ +#else + NTStatus = 0xC00000B5L; /* I/O Timeout */ #endif } else if (code == CM_ERROR_RETRY) { +#ifdef COMMENT NTStatus = 0xC000022DL; /* Retry */ +#else + NTStatus = 0xC00000B5L; /* I/O Timeout */ +#endif } else if (code == CM_ERROR_NOACCESS) { NTStatus = 0xC0000022L; /* Access denied */ @@ -3139,7 +3147,11 @@ void smb_MapNTError(long code, unsigned long *NTStatusp) NTStatus = 0xC0000257L; /* Path Not Covered */ } else if (code == CM_ERROR_ALLBUSY) { +#ifdef COMMENT NTStatus = 0xC000022DL; /* Retry */ +#else + NTStatus = 0xC00000B5L; /* I/O Timeout */ +#endif } else if (code == CM_ERROR_ALLOFFLINE || code == CM_ERROR_ALLDOWN) { NTStatus = 0xC000003AL; /* Path not found */ -- 1.9.4