mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 07:20:11 +00:00
afs: Warn about afs_conn overcounts
Currently we panic if we detect an undercount on an afs_conn structure, as this is a serious bug and can cause corruption and other issues. But an overcount is never noticed, until the refCount overflows and looks negative. Log a warning if the refCount gets really high, so an administrator has a chance at noticing and notifying a developer before the machine actually panics. [kaduk@mit.edu use the %p format specifier, mandated by C89] Change-Id: Ifc291fc10959e4e1c60115813d82a09e5a65ef75 Reviewed-on: http://gerrit.openafs.org/11465 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Daria Brashear <shadow@your-file-system.com>
This commit is contained in:
parent
0c89335b5a
commit
fa5434adf1
@ -453,6 +453,18 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (tc->refCount > 10000) {
|
||||
static int warned;
|
||||
if (!warned) {
|
||||
warned = 1;
|
||||
afs_warn("afs: Very high afs_conn refCount detected (conn %p, count %d)\n",
|
||||
tc, (int)tc->refCount);
|
||||
afs_warn("afs: Trying to continue, but this may indicate an issue\n");
|
||||
afs_warn("afs: that may eventually crash the machine. Please file\n");
|
||||
afs_warn("afs: a bug report.\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (tu->states & UTokensBad) {
|
||||
/* we may still have an authenticated RPC connection here,
|
||||
* we'll have to create a new, unauthenticated, connection.
|
||||
|
Loading…
Reference in New Issue
Block a user