[OpenAFS-devel] Linux cache manager throwing away callbacks

Chas Williams (CONTRACTOR) chas@cmf.nrl.navy.mil
Tue, 20 Jan 2009 18:43:02 -0500


"Chas Williams (CONTRACTOR)" writes:
>In message <db6e3f110901190757t4f4936cdo5cf4a2a9ea34b28b@mail.gmail.com>,"Derr
>i
>ck Brashear" writes:
>>> afs_InactiveVCache() already has a conditional check for CUnlinked so
>>> i didnt think it was helpful to check twice.
>>
>>But the call to clear e.g. CDirty and InvalidateAllSegments() happens
>>outside that check, which I'm pretty sure at best can cause us to need
>>to revalidate that our data is current and at worst will discard
>>unwritten data.
>
>checking CUnlinked doesnt prevent that.  this code in .dentry_iput has
>been around quite a while i think.

after thinking about this a bit, perhaps the check for CUnlinked should
be stuck back in .dentry_iput.  this should be all you need.  the
background cache manager is always going to try to write all the data
hopefully it will eventually complete and clear the CDirty flag.  if
dentry_iput is called on an unlinked file you might as well go ahead
invalidate the existing data in the cache.  it is an unlinked file after
all.