Updated openstack/openstack
Project: openstack/nova  3073498bd385507b9efff36ddea2b736b6ac8394
null
Fix race conditions between imagebackend and imagecache

The race may occur in the situation:
* There is a base file that is not used for a long time enough
  to be removed by imagecache.
* imagebackend is provisioning a virtual disk from the base file.
* imagecache is removing the base file.

Then, the base file is removed even though it is about to be used.

To fix this, these changes are in this patch:

* A new function imagecache.refresh_timestamp(base_file) updates
  the owner and mtime of the base file with the lock dedicated
  to the base file.
* imagebacked calls refresh_timestamp(base_file) before provision
  a disk from the base file.
* imagecache.ImageCacheManager._remove_base_file(base_file) uses
  the same lock as used by refresh_timestamp()

Closes-Bug: #1256838
Change-Id: I7c897cf6071d87a2c4532fb3a73863d649d02782