At Mon, 23 Apr 2012 08:08:46 +0200, Christoph Hellwig wrote: > > On Fri, Apr 20, 2012 at 12:15:36PM -0700, MORITA Kazutaka wrote: > > His patch sets the SD_FLAG_CMD_CACHE flag for writes only when the > > user selects cache=writeback or cache=none. If SD_FLAG_CMD_CACHE is > > not set in the request, Sheepdog servers are forced to flush the cache > > like FUA commands. > > Ok, I missed that part and it thus seems ok. What still sems missing > is error handling in case the sheepdog cluster doesn't actually support > the new flag. What happens if cache=none is specified with a cluster > not actually supporting it? Remember that cache=none is the default for > many management frontends to qemu.
SD_FLAG_CMD_CACHE is ignored in the older version of Sheepdog, so, even if we specify cache=writeback or cache=none, the data is written with O_DSYNC always and cannot be cached in the server's page cache or volatile disk cache either. I think it is safe. It seems that there is another version problem with this patch; bdrv_co_flush_to_disk() results in error with the older Sheepdog which doesn't support SD_OP_FLUSH_VDI. The simple fix is to increment SD_PROTO_VER and prevent the newer qemu from connecting to the older Sheepdog cluster, I think. Thanks, Kazutaka