0,
storeClientReadHeader,
sc);
- else
+ else {
+ if (sc->entry->swap_status == SWAPOUT_WRITING)
+ assert(mem->swapout.done_offset > sc->copy_offset + mem->swap_hdr_sz);
file_read(sc->swapin_fd,
sc->copy_buf,
sc->copy_size,
sc->copy_offset + mem->swap_hdr_sz,
storeClientReadBody,
sc);
+ }
sc->flags.disk_io_pending = 1;
}
mem->inmem_lo = new_mem_lo;
return;
}
+#if USE_QUEUE_OFFSET
+ /*
+ * This feels wrong. We should only free up to what we know
+ * has been written to disk, not what has been queued for
+ * writing. Otherwise there will be a chunk of the data which
+ * is not in memory and is not yet on disk.
+ */
if (mem->swapout.queue_offset < new_mem_lo)
new_mem_lo = mem->swapout.queue_offset;
+#else
+ if (mem->swapout.done_offset < new_mem_lo)
+ new_mem_lo = mem->swapout.done_offset;
+#endif
stmemFreeDataUpto(&mem->data_hdr, new_mem_lo);
mem->inmem_lo = new_mem_lo;