OpenAFS Master Repository branch, openafs-stable-1_6_x, updated. openafs-stable-1_6_11pre1-3-gfba3904
Gerrit Code Review
gerrit@openafs.org
Fri, 23 Jan 2015 02:38:17 -0500
The following commit has been merged in the openafs-stable-1_6_x branch:
commit fba39040435afe63b0737945e2269375107fc686
Author: Andrew Deason <adeason@sinenomine.net>
Date: Sun Sep 14 14:10:11 2014 -0500
afs: Fix some afs_conn overcounts
The usual pattern of using afs_Conn looks like this:
do {
tc = afs_Conn(...);
if (tc) {
code = /* ... */
} else {
code = -1;
}
} while (afs_Analyze(...));
The afs_Analyze call, amongst other things, puts back the reference to
the connection obtained from afs_Conn. If anything inside the do/while
block exits that block without calling afs_Analyze or afs_PutConn, we
will leak a reference to the conn.
A few places currently do this, by jumping out of the loop with
'goto's. Specifically, in afs_dcache.c and afs_bypasscache.c. These
locations currently leak references to our connection object (and to
the underlying Rx connection object), which can cause problems over
time. Specifically, this can cause a panic when the refcount overflows
and becomes negative, causing a panic message that looks like:
afs_PutConn: refcount imbalance 0xd34db33f -32768
To avoid this, make sure we afs_PutConn in these cases where we 'goto'
out of the afs_Conn/afs_Analyze loop. Perhaps ideally we should cause
afs_Analyze itself to be called in these situations, but for now just
fix the problem with the least amount of impact possible.
FIXES 131885
Reviewed-on: http://gerrit.openafs.org/11464
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 54c0ee608f4afd2b178c9b60eabfc3564293d996)
Change-Id: Ic02ede4f8177863e8079b4a92c9bad492d6dc97b
Reviewed-on: http://gerrit.openafs.org/11645
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/afs/afs_bypasscache.c | 1 +
src/afs/afs_dcache.c | 7 +++++++
2 files changed, 8 insertions(+), 0 deletions(-)
--
OpenAFS Master Repository