/* we found a request */
for (rp = cm_bkgListEndp; rp; rp = (cm_bkgRequest_t *) osi_QPrev(&rp->q))
{
- if (cm_ServerAvailable(&rp->scp->fid, rp->userp))
+ if (cm_ServerAvailable(&rp->scp->fid, rp->userp) &&
+ !(rp->scp->flags & CM_SCACHEFLAG_DATASTORING))
break;
}
if (rp == NULL) {
lock_ObtainWrite(&cm_daemonLock);
+ /*
+ * Keep the following list synchronized with the
+ * error code list in cm_BkgStore
+ */
switch ( code ) {
case 0: /* success */
osi_Log1(afsd_logp,"cm_BkgDaemon SUCCESS: request 0x%p", rp);
osi_Log4(afsd_logp, "Finished BKG store scp 0x%p, offset 0x%x:%08x, code 0x%x", scp, p2, p1, code);
}
- lock_ObtainWrite(&scp->rw);
- cm_SyncOpDone(scp, NULL, CM_SCACHESYNC_ASYNCSTORE);
- lock_ReleaseWrite(&scp->rw);
-
+ /*
+ * Keep the following list synchronized with the
+ * error code list in cm_BkgDaemon
+ */
+ switch ( code ) {
+ case CM_ERROR_TIMEDOUT: /* or server restarting */
+ case CM_ERROR_RETRY:
+ case CM_ERROR_WOULDBLOCK:
+ case CM_ERROR_ALLBUSY:
+ case CM_ERROR_ALLDOWN:
+ case CM_ERROR_ALLOFFLINE:
+ case CM_ERROR_PARTIALWRITE:
+ break; /* cm_BkgDaemon will re-insert the request in the queue */
+ case 0:
+ default:
+ lock_ObtainWrite(&scp->rw);
+ cm_SyncOpDone(scp, NULL, CM_SCACHESYNC_ASYNCSTORE);
+ lock_ReleaseWrite(&scp->rw);
+ }
return code;
}
if (outp == NULL)
return 1;
- if (index >= MAXNUMSYSNAMES)
+ if (index >= cm_sysNameCount)
return -1;
/* otherwise generate the properly expanded @sys name */
* being a little conservative here.
*/
if (strlen(linkScp->mountPointStringp) + strlen(pathSuffixp) + 2
- >= CM_UTILS_SPACESIZE)
- return CM_ERROR_TOOBIG;
+ >= CM_UTILS_SPACESIZE) {
+ code = CM_ERROR_TOOBIG;
+ goto done;
+ }
tsp = cm_GetSpace();
linkp = linkScp->mountPointStringp;