#endif
code = cm_Lookup(dscp, cnamep, CM_FLAG_NOMOUNTCHASE, userp, reqp, &scp);
+ if (code)
+ goto done;
+
+ /* Check for RO volume */
+ if (dscp->flags & CM_SCACHEFLAG_RO) {
+ code = CM_ERROR_READONLY;
+ goto done;
+ }
/* make sure we don't screw up the dir status during the merge */
code = cm_BeginDirOp(dscp, userp, reqp, CM_DIRLOCK_NONE,
return cm_SetLength(scp, &attrp->length, userp, reqp);
lock_ObtainWrite(&scp->rw);
+ /* Check for RO volume */
+ if (scp->flags & CM_SCACHEFLAG_RO) {
+ code = CM_ERROR_READONLY;
+ lock_ReleaseWrite(&scp->rw);
+ return code;
+ }
+
/* otherwise, we have to make an RPC to get the status */
code = cm_SyncOp(scp, NULL, userp, reqp, 0, CM_SCACHESYNC_STORESTATUS);
if (code) {
}
#endif /* AFS_FREELANCE_CLIENT */
+ /* Check for RO volume */
+ if (dscp->flags & CM_SCACHEFLAG_RO)
+ return CM_ERROR_READONLY;
+
/* before starting the RPC, mark that we're changing the file data, so
* that someone who does a chmod will know to wait until our call
* completes.
}
#endif /* AFS_FREELANCE_CLIENT */
+ /* Check for RO volume */
+ if (dscp->flags & CM_SCACHEFLAG_RO)
+ return CM_ERROR_READONLY;
+
/* before starting the RPC, mark that we're changing the directory
* data, so that someone who does a chmod on the dir will wait until
* our call completes.
return CM_ERROR_CROSSDEVLINK;
}
+ /* Check for RO volume */
+ if (dscp->flags & CM_SCACHEFLAG_RO)
+ return CM_ERROR_READONLY;
+
cm_BeginDirOp(dscp, userp, reqp, CM_DIRLOCK_NONE, CM_DIROP_FLAG_NONE,
&dirop);
lock_ObtainWrite(&dscp->rw);
cm_dirOp_t dirop;
fschar_t *fnamep = NULL;
+ /* Check for RO volume */
+ if (dscp->flags & CM_SCACHEFLAG_RO)
+ return CM_ERROR_READONLY;
+
memset(&volSync, 0, sizeof(volSync));
/* before starting the RPC, mark that we're changing the directory data,
if (code)
goto done;
+ /* Check for RO volume */
+ if (dscp->flags & CM_SCACHEFLAG_RO) {
+ code = CM_ERROR_READONLY;
+ goto done;
+ }
+
/* before starting the RPC, mark that we're changing the directory data,
* so that someone who does a chmod on the dir will wait until our
* call completes.
} else {
code = 0;
}
+
+ /* Check for RO volume */
+ if (code == 0 &&
+ (oldDscp->flags & CM_SCACHEFLAG_RO) || (newDscp->flags & CM_SCACHEFLAG_RO)) {
+ code = CM_ERROR_READONLY;
+ }
+
if (code)
goto done;