Do not mark locks lost simply because the ExtendLock failed.
A lock is only lost if the server responds with EINVAL indicating
that the lock no longer exists. A lock can be renewed by other clients
that are also using the file. The client can make no assumptions about
the status of a lock based upon the passage of time.
(cherry picked from commit
8445720d36474797b67341991f15771dcb90b236)
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
+#include <errno.h>
#include <osi.h>
if (code) {
osi_Log1(afsd_logp, "CALL ExtendLock FAILURE, code 0x%x", code);
- cm_LockMarkSCacheLost(scp);
+ if (code == EINVAL || code == CM_ERROR_INVAL)
+ cm_LockMarkSCacheLost(scp);
} else {
osi_Log0(afsd_logp, "CALL ExtendLock SUCCESS");
}