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

MORITA Kazutaka morita.kazutaka at gmail.com
Sat Mar 31 08:29:09 CEST 2012


At Sat, 31 Mar 2012 14:08:45 +0800,
Liu Yuan wrote:
> 
> 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 still understand why we can't process collie requests with the
above way.  Can you give me an example for it?

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

This is not a corner case.  If we create VDIs with 'qemu-img convert',
we cannot access them with a writethourgh mode since their caches
exist.

Thanks,

Kazutaka



More information about the sheepdog mailing list