[Sheepdog] [PATCH v6 7/8] collie: read the cached objects if any for collie operation

Liu Yuan namei.unix at gmail.com
Sat Mar 31 08:08:45 CEST 2012


On 03/31/2012 12:25 AM, MORITA Kazutaka wrote:

> This fix is still wrong because writethrough requests aren't flushed
> before sending response if we return 0 here.
> 
> I think we need to flush and remove a cache here when
> SD_FLAG_CMD_CACHE is not set.


It is more precisely a half fix. If all the RW requests are from Guest,
we can simply add a function to flush and remove the cache for that VDI
like below:

static int bypass_object_cache(struct sd_obj_req *hdr)
{
	...
        if (!(hdr->flags & SD_FLAG_CMD_CACHE)) {
		if (find_object_cache(vdi))
			flush_and_delete(vdi);
                return 1;
	}
	...
}

But we simply can't do it, since collie will issue RW requets without
the knowledge if we have cache enabled or not.

I don't find a solution to handle this situation cleanly yet and leave
this corner case for future patch.

Thanks,
Yuan




More information about the sheepdog mailing list