From: Andrew Deason Date: Fri, 16 Nov 2012 20:18:32 +0000 (-0600) Subject: afs: Fix VLRU traversal sanity check X-Git-Tag: upstream/1.6.2_pre2^2~63 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=14657f6bacb3607dc20d1846202744d2f6e83daf;p=packages%2Fo%2Fopenafs.git afs: Fix VLRU traversal sanity check On non-Linux, the number of vcaches in the VLRU can easily exceed afs_maxvcount, since we allocate new vcaches when we run out. So, assume we only have afs_vcount vcaches on the VLRU, instead of assuming we have at most afs_maxvcount vcaches. Reviewed-on: http://gerrit.openafs.org/8471 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit bc6dd95016c63d0742698d902aebf73c01162c24) Change-Id: Id4884e45a52813eb33926958b11148a021ca3057 Reviewed-on: http://gerrit.openafs.org/8606 Reviewed-by: Michael Meffie Reviewed-by: Paul Smeddle Tested-by: BuildBot Reviewed-by: Stephan Wiesand Tested-by: Stephan Wiesand --- diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index ca07e923a..29f7a4c0c 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -670,9 +670,8 @@ afs_ShakeLooseVCaches(afs_int32 anumber) uq = QPrev(tq); if (tvc->f.states & CVFlushed) { refpanic("CVFlushed on VLRU"); - /* In the other path, this was 2 * afs_cacheStats */ - } else if (!afsd_dynamic_vcaches && i++ > afs_maxvcount) { - refpanic("Exceeded pool of AFS vnodes(VLRU cycle?)"); + } else if (!afsd_dynamic_vcaches && i++ > afs_vcount) { + refpanic("Found too many AFS vnodes on VLRU (VLRU cycle?)"); } else if (QNext(uq) != tq) { refpanic("VLRU inconsistent"); } else if (tvc->f.states & CVInit) {