mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 07:20:11 +00:00
host-tossstuff-locking-20060309
the nonblocking locking was my fault.
This commit is contained in:
parent
cc324ae065
commit
9b1fa66828
@ -714,16 +714,27 @@ h_TossStuff_r(register struct host *host)
|
|||||||
/* ASSUMPTION: rxi_FreeConnection() does not yield */
|
/* ASSUMPTION: rxi_FreeConnection() does not yield */
|
||||||
for (cp = &host->FirstClient; (client = *cp);) {
|
for (cp = &host->FirstClient; (client = *cp);) {
|
||||||
if ((host->hostFlags & HOSTDELETED) || client->deleted) {
|
if ((host->hostFlags & HOSTDELETED) || client->deleted) {
|
||||||
|
int code;
|
||||||
|
ObtainWriteLockNoBlock(&client->lock, code);
|
||||||
|
if (code < 0) {
|
||||||
|
char hoststr[16];
|
||||||
|
ViceLog(0,
|
||||||
|
("Warning: h_TossStuff_r failed: Host %s:%d client %x was locked.\n",
|
||||||
|
afs_inet_ntoa_r(host->host, hoststr),
|
||||||
|
ntohs(host->port), client));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (client->refCount) {
|
if (client->refCount) {
|
||||||
char hoststr[16];
|
char hoststr[16];
|
||||||
ViceLog(0,
|
ViceLog(0,
|
||||||
("Warning: Host %s:%d client %x refcount %d while deleting, failing.\n",
|
("Warning: h_TossStuff_r failed: Host %s:%d client %x refcount %d.\n",
|
||||||
afs_inet_ntoa_r(host->host, hoststr),
|
afs_inet_ntoa_r(host->host, hoststr),
|
||||||
ntohs(host->port), client, client->refCount));
|
ntohs(host->port), client, client->refCount));
|
||||||
/* This is the same thing we do if the host is locked */
|
/* This is the same thing we do if the host is locked */
|
||||||
|
ReleaseWriteLock(&client->lock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* We can't protect this without dropping the H_LOCK */
|
|
||||||
client->CPS.prlist_len = 0;
|
client->CPS.prlist_len = 0;
|
||||||
if ((client->ViceId != ANONYMOUSID) && client->CPS.prlist_val)
|
if ((client->ViceId != ANONYMOUSID) && client->CPS.prlist_val)
|
||||||
free(client->CPS.prlist_val);
|
free(client->CPS.prlist_val);
|
||||||
@ -733,6 +744,7 @@ h_TossStuff_r(register struct host *host)
|
|||||||
}
|
}
|
||||||
CurrentConnections--;
|
CurrentConnections--;
|
||||||
*cp = client->next;
|
*cp = client->next;
|
||||||
|
ReleaseWriteLock(&client->lock);
|
||||||
FreeCE(client);
|
FreeCE(client);
|
||||||
} else
|
} else
|
||||||
cp = &client->next;
|
cp = &client->next;
|
||||||
|
Loading…
Reference in New Issue
Block a user