shutdown: Lock records during dbCa link cleanup
CA links in records were being removed without locking them first. We also now set the link type to CONSTANT, which prevents some assertion failures if the record gets processed again before the IOC finally dies.
This commit is contained in:
1 parent
d286a81ef0
commit
35b72b60fb
1 file changed
+14
@@ -506,6 +506,7 @@ static void doCloseLinks(dbRecordType *pdbRecordType, dbCommon *precord,
|
||||
devSup *pdevSup;
|
||||
struct dsxt *pdsxt;
|
||||
int j;
|
||||
int locked = 0;
|
||||
|
||||
for (j = 0; j < pdbRecordType->no_links; j++) {
|
||||
dbFldDes *pdbFldDes =
|
||||
@@ -513,7 +514,12 @@ static void doCloseLinks(dbRecordType *pdbRecordType, dbCommon *precord,
|
||||
DBLINK *plink = (DBLINK *)((char *)precord + pdbFldDes->offset);
|
||||
|
||||
if (plink->type == CA_LINK) {
|
||||
if (!locked) {
|
||||
dbScanLock(precord);
|
||||
locked = 1;
|
||||
}
|
||||
dbCaRemoveLink(plink);
|
||||
plink->type = CONSTANT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,8 +527,16 @@ static void doCloseLinks(dbRecordType *pdbRecordType, dbCommon *precord,
|
||||
(pdevSup = dbDSETtoDevSup(pdbRecordType, precord->dset)) &&
|
||||
(pdsxt = pdevSup->pdsxt) &&
|
||||
pdsxt->del_record) {
|
||||
if (!locked) {
|
||||
dbScanLock(precord);
|
||||
locked = 1;
|
||||
}
|
||||
pdsxt->del_record(precord);
|
||||
}
|
||||
if (locked) {
|
||||
precord->pact = TRUE;
|
||||
dbScanUnlock(precord);
|
||||
}
|
||||
}
|
||||
|
||||
static void exitDatabase(void *dummy)
|
||||
|
||||
Reference in new issue
Block a user