libafs: Fix second pass in ShakeLooseVCaches
[openafs.git] / src / afs / afs_vcache.c
index 350ba78..8af3cde 100644 (file)
@@ -172,7 +172,7 @@ afs_FlushVCache(struct vcache *avc, int *slept)
     for (wvc = *uvc; wvc; uvc = &wvc->hnext, wvc = *uvc) {
        if (avc == wvc) {
            *uvc = avc->hnext;
-           avc->hnext = (struct vcache *)NULL;
+           avc->hnext = NULL;
            break;
        }
     }
@@ -736,10 +736,11 @@ afs_ShakeLooseVCaches(afs_int32 anumber)
            i = 0;
            continue;   /* start over - may have raced. */
        }
-       if (tq == uq) {
+       if (uq == &VLRU) {
            if (anumber && !defersleep) {
                defersleep = 1;
-               tq = VLRU.prev;
+               uq = VLRU.prev;
+               i = 0;
                continue;
            }
            break;