discon remove dirty vcaches from queue when discarding
authorDerrick Brashear <shadow@dementia.org>
Wed, 4 Aug 2010 13:04:34 +0000 (09:04 -0400)
committerDerrick Brashear <shadow@dementia.org>
Wed, 4 Aug 2010 14:31:03 +0000 (07:31 -0700)
the discardall loop was not dequeueing vcaches, meaning we would loop.
caught by Simon Wilkinson

Change-Id: I80256ef5f91d7030e0cb11e78a79f137a217a29a
Reviewed-on: http://gerrit.openafs.org/2513
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/afs/afs_disconnected.c

index ff5e978..2097761 100644 (file)
@@ -1338,14 +1338,15 @@ afs_DisconDiscardAll(afs_ucred_t *acred)
     ObtainWriteLock(&afs_disconDirtyLock, 717);
     while (!QEmpty(&afs_disconDirty)) {
        tvc = QEntry(QPrev(&afs_disconDirty), struct vcache, dirtyq);
+       QRemove(&tvc->dirtyq);
        ReleaseWriteLock(&afs_disconDirtyLock);
 
        ObtainWriteLock(&tvc->lock, 718);
        afs_ResetVCache(tvc, acred);
        tvc->f.truncPos = AFS_NOTRUNC;
        ReleaseWriteLock(&tvc->lock);
-       afs_PutVCache(tvc);
        ObtainWriteLock(&afs_disconDirtyLock, 719);
+       afs_PutVCache(tvc);
     }
 
     afs_DisconDiscardAllShadows(1, acred);