afs: Do not QueueVCB before osi_dnlc_purge*
authorAndrew Deason <adeason@sinenomine.net>
Fri, 18 May 2012 21:40:38 +0000 (17:40 -0400)
committerDerrick Brashear <shadow@dementix.org>
Thu, 24 May 2012 16:29:04 +0000 (09:29 -0700)
commit0e81db38b549d79a3af5fce0f9f8fa48d9e6efeb
tree008a7e49c9a83bf01713843572abe0f76e1573d2
parent7b35b409a484772989bb76633232b6e1d4f9bcc5
afs: Do not QueueVCB before osi_dnlc_purge*

In afs_FlushVCache, when we QueueVCB, we might drop the afs_xvcache
lock (as of 76158df491f47de56d1febe1d1d2d17d316c9a74). The vcache may
still be on the DNLC, so a lookup while xvcache is dropped can cause
someone else to grab a reference to the vcache while it is being
flushed. This can cause panics and failed assertions, since someone
will have a reference to the flushed vcache, which is effectively
freed and many of the structure fields are no longer valid.

So instead, do not call QueueVCB until we have purged the vcache from
the DNLC.

Change-Id: Ia6b51b4a2bb26903346217fbd6fc7d959d87eae7
Reviewed-on: http://gerrit.openafs.org/7430
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/afs/afs_vcache.c