X-Git-Url: http://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fafs%2Fafs_vcache.c;h=45cde7f7f3137123c3b78c461fa695dce38dcb04;hp=dad73bbfe7b23856d5c08a572a3a1c23922f7503;hb=de1ac7daff3183bf5b2c2a3482e74a099f7fb641;hpb=73bfe94802ef62a7e6f8d2c36cb801be6ab2863a diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index dad73bb..45cde7f 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -138,6 +138,10 @@ afs_FlushVCache(struct vcache *avc, int *slept) afs_int32 i, code; struct vcache **uvc, *wvc; + /* NOTE: We must have nothing drop afs_xvcache until we have removed all + * possible references to this vcache. This means all hash tables, queues, + * DNLC, etc. */ + *slept = 0; AFS_STATCNT(afs_FlushVCache); afs_Trace2(afs_iclSetp, CM_TRACE_FLUSHV, ICL_TYPE_POINTER, avc, @@ -214,6 +218,10 @@ afs_FlushVCache(struct vcache *avc, int *slept) else osi_dnlc_purgevp(avc); + /* By this point, the vcache has been removed from all global structures + * via which someone could try to use the vcache. It is okay to drop + * afs_xvcache at this point (if *slept is set). */ + if (!afs_shuttingdown) afs_QueueVCB(avc, slept);