LICENSE MIT
Prevent corruption of the cm_data.scacheHashTablep lists when removing
and then re-adding entries to the hash table. The cm_scache_t nextp
fields were not being reset to NULL which permitted loops to be created.
(cherry picked from commit
ef48d6343d9ac929a4a2ae88184f7801ace1e3d1)
lscpp = &tscp->nextp, tscp = tscp->nextp) {
if (tscp == scp) {
*lscpp = scp->nextp;
+ scp->nextp = NULL;
lock_ObtainWrite(&scp->rw);
scp->flags &= ~CM_SCACHEFLAG_INHASH;
lock_ReleaseWrite(&scp->rw);
lscpp = &tscp->nextp, tscp = tscp->nextp) {
if (tscp == scp) {
*lscpp = scp->nextp;
+ scp->nextp = NULL;
scp->flags &= ~CM_SCACHEFLAG_INHASH;
break;
}
scp->dotdotFid.vnode=1;
scp->flags |= (CM_SCACHEFLAG_PURERO | CM_SCACHEFLAG_RO);
if (!(scp->flags & CM_SCACHEFLAG_INHASH)) {
- scp->nextp=cm_data.scacheHashTablep[hash];
- cm_data.scacheHashTablep[hash]=scp;
+ scp->nextp = cm_data.scacheHashTablep[hash];
+ cm_data.scacheHashTablep[hash] = scp;
scp->flags |= CM_SCACHEFLAG_INHASH;
}
scp->refCount = 1;