From 8ebed5ba057d18a5ab08a0d7b2cee96c72f1f9ff Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 8 Mar 2009 18:49:06 +0100 Subject: [PATCH] Fix generation numbers for news file nreport() caches recent news reports in cache[], so it can collapse multiple news reports into one. Writing back such a collapsed news report triggered a generation oops when the processor had been yielded since the cached report was last written back. But this is actually perfectly safe, because the cache can't become stale: news file updates either go through the cache (nreport()), or they clear the entire cache (delete_old_news()). Silence the oops by marking the news report fresh. A case could be made for removing nws_generation alltogether. Maybe later. --- src/lib/subs/nreport.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/subs/nreport.c b/src/lib/subs/nreport.c index 0bce9462..bcb9be58 100644 --- a/src/lib/subs/nreport.c +++ b/src/lib/subs/nreport.c @@ -61,6 +61,8 @@ nreport(natid actor, int event, natid victim, int times) return; np = ncache(actor, event, victim, times); + /* TODO get rid of nws_generation? */ + ef_mark_fresh(EF_NEWS, np); putnews(np->nws_uid, np); /*