static void cloudlog_partial_fetch_complete(BlueSkyStoreAsync *async,
BlueSkyCacheFile *cachefile)
{
static void cloudlog_partial_fetch_complete(BlueSkyStoreAsync *async,
BlueSkyCacheFile *cachefile)
{
async->key, async->result);
g_mutex_lock(cachefile->lock);
if (async->result >= 0) {
async->key, async->result);
g_mutex_lock(cachefile->lock);
if (async->result >= 0) {
/* Descrypt items fetched and write valid items out to the local log,
* but only if they do not overlap existing objects. This will protect
* against an attack by the cloud provider where one valid object is
/* Descrypt items fetched and write valid items out to the local log,
* but only if they do not overlap existing objects. This will protect
* against an attack by the cloud provider where one valid object is
BlueSkyRangeset *items = bluesky_rangeset_new();
int fd = openat(cachefile->log->dirfd, cachefile->filename, O_WRONLY);
if (fd >= 0) {
BlueSkyRangeset *items = bluesky_rangeset_new();
int fd = openat(cachefile->log->dirfd, cachefile->filename, O_WRONLY);
if (fd >= 0) {