sunrpc: use seconds since boot in expiry cache

This protects us from confusion when the wallclock time changes.

We convert to and from wallclock when  setting or reading expiry
times.

Also use seconds since boot for last_clost time.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
NeilBrown
2010-08-12 16:55:22 +10:00
committed by J. Bruce Fields
parent 17cebf658e
commit c5b29f885a
4 changed files with 48 additions and 24 deletions

View File

@@ -550,7 +550,7 @@ do_idmap_lookup_nowait(struct ent *(*lookup_fn)(struct ent *),
goto out_err;
ret = -ETIMEDOUT;
if (!test_bit(CACHE_VALID, &(*item)->h.flags)
|| (*item)->h.expiry_time < get_seconds()
|| (*item)->h.expiry_time < seconds_since_boot()
|| detail->flush_time > (*item)->h.last_refresh)
goto out_put;
ret = -ENOENT;