From 9f0f50a2b165392fc0a62f82d8c54e35108ab429 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 18 Oct 2005 21:52:47 +0000 Subject: [PATCH] windows-locking-error-codes-20051018 cm_Lock(), cm_RetryLock() should not interpret servers be unreachable as a sharing violation. --- src/WINNT/afsd/cm_vnodeops.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index b490773b03..16a7ebee16 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -300,8 +300,19 @@ long cm_CheckOpen(cm_scache_t *scp, int openMode, int trunc, cm_user_t *userp, if (code == CM_ERROR_NOACCESS && !(rights & PRSFS_WRITE)) code = 0; - else - code = CM_ERROR_SHARING_VIOLATION; + else { + switch (code) { + case CM_ERROR_ALLOFFLINE: + case CM_ERROR_ALLDOWN: + case CM_ERROR_ALLBUSY: + case CM_ERROR_TIMEDOUT: + case CM_ERROR_RETRY: + case CM_ERROR_WOULDBLOCK: + break; + default: + code = CM_ERROR_SHARING_VIOLATION; + } + } } } @@ -377,8 +388,19 @@ long cm_CheckNTOpen(cm_scache_t *scp, unsigned int desiredAccess, if (code == CM_ERROR_NOACCESS && !(rights & PRSFS_WRITE)) code = 0; - else - code = CM_ERROR_SHARING_VIOLATION; + else { + switch (code) { + case CM_ERROR_ALLOFFLINE: + case CM_ERROR_ALLDOWN: + case CM_ERROR_ALLBUSY: + case CM_ERROR_TIMEDOUT: + case CM_ERROR_RETRY: + case CM_ERROR_WOULDBLOCK: + break; + default: + code = CM_ERROR_SHARING_VIOLATION; + } + } } }