]> gitweb.ps.run Git - ps-cgit/commitdiff
Don't truncate valid cachefiles
authorLars Hjemli <hjemli@gmail.com>
Mon, 11 Dec 2006 21:53:50 +0000 (22:53 +0100)
committerLars Hjemli <hjemli@gmail.com>
Mon, 11 Dec 2006 21:53:50 +0000 (22:53 +0100)
An embarrassing thinko in cgit_check_cache() would truncate valid cachefiles
in the following situation:
  1) process A notices a missing/expired cachefile
  2) process B gets scheduled, locks, fills and unlocks the cachefile
  3) process A gets scheduled, locks the cachefile, notices that the cachefile
     now exist/is not expired anymore, and continues to overwrite it with an
     empty lockfile.

Thanks to Linus for noticing (again).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>

No differences found