#define CREATE_SGUID_ADMIN_ONLY 1
+
+/**
+ * Abort the fileserver on fatal errors returned from vnode operations.
+ */
+#define assert_vnode_success_or_salvaging(code) \
+ opr_Assert((code) == 0 || (code) == VSALVAGE || (code) == VSALVAGING)
+
extern struct afsconf_dir *confDir;
extern afs_int32 dataVersionHigh;
return (errorCode);
if ((*vptr)->disk.uniquifier != fid->Unique) {
VPutVnode(&fileCode, *vptr);
- opr_Assert(fileCode == 0);
+ assert_vnode_success_or_salvaging(fileCode);
*vptr = 0;
return (VNOVNODE); /* return the right error code, at least */
}
rx_KeepAliveOff(acall);
if (parentwhentargetnotdir) {
VPutVnode(&fileCode, parentwhentargetnotdir);
- opr_Assert(!fileCode || (fileCode == VSALVAGE));
+ assert_vnode_success_or_salvaging(fileCode);
}
if (targetptr) {
VPutVnode(&fileCode, targetptr);
- opr_Assert(!fileCode || (fileCode == VSALVAGE));
+ assert_vnode_success_or_salvaging(fileCode);
}
if (parentptr) {
VPutVnode(&fileCode, parentptr);
- opr_Assert(!fileCode || (fileCode == VSALVAGE));
+ assert_vnode_success_or_salvaging(fileCode);
}
if (volptr) {
VPutVolumeWithCall(volptr, cbv);
if (parentwhentargetnotdir != NULL) {
tparentwhentargetnotdir = *parentwhentargetnotdir;
VPutVnode(&fileCode, parentwhentargetnotdir);
- opr_Assert(!fileCode || (fileCode == VSALVAGE));
+ assert_vnode_success_or_salvaging(fileCode);
parentwhentargetnotdir = NULL;
}
rx_KeepAliveOff(acall);
VPutVnode(&fileCode, parentwhentargetnotdir);
rx_KeepAliveOn(acall);
- opr_Assert(!fileCode || (fileCode == VSALVAGE));
+ assert_vnode_success_or_salvaging(fileCode);
parentwhentargetnotdir = NULL;
}
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, targetptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
rx_KeepAliveOn(acall);
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, targetptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
/* Break call backs on Fid */
BreakCallBack(client->z.host, Fid, 0);
DeleteFileCallBacks(&fileFid);
/* convert the parent lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
} else {
/* convert the parent lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
/* convert the target lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, targetptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
/* tell all the file has changed */
BreakCallBack(client->z.host, &fileFid, 1);
}
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
/* break call back on parent dir */
BreakCallBack(client->z.host, DirFid, 0);
}
if (testnode == 1) top = 1;
testvptr = VGetVnode(&errorCode, volptr, testnode, READ_LOCK);
- opr_Assert(errorCode == 0);
+ assert_vnode_success_or_salvaging(errorCode);
testnode = testvptr->disk.parent;
VPutVnode(&errorCode, testvptr);
if ((top == 1) && (testnode != 0)) {
errorCode = EIO;
goto Bad_Rename;
}
- opr_Assert(errorCode == 0);
+ assert_vnode_success_or_salvaging(errorCode);
}
}
/* convert the write locks to a read locks before breaking callbacks */
VVnodeWriteToRead(&errorCode, newvptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
if (oldvptr != newvptr) {
VVnodeWriteToRead(&errorCode, oldvptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
}
if (newfileptr && !doDelete) {
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, newfileptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
}
rx_KeepAliveOn(acall);
if (newfileptr) {
rx_KeepAliveOff(acall);
VPutVnode(&fileCode, newfileptr);
- opr_Assert(fileCode == 0);
+ assert_vnode_success_or_salvaging(fileCode);
}
(void)PutVolumePackage(acall, fileptr, (newvptr && newvptr != oldvptr ?
newvptr : 0), oldvptr, volptr, &client);
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
rx_KeepAliveOn(acall);
/* convert the write locks to read locks before breaking callbacks */
VVnodeWriteToRead(&errorCode, targetptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
VVnodeWriteToRead(&errorCode, parentptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
rx_KeepAliveOn(acall);
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
rx_KeepAliveOn(acall);
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
rx_KeepAliveOn(acall);
rx_KeepAliveOn(acall);
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, targetptr);
- opr_Assert(!errorCode || errorCode == VSALVAGE);
+ assert_vnode_success_or_salvaging(errorCode);
BreakCallBack(client->z.host, Fid, 0);
}