From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: Re: [PATCH v2] introduce a cache options for PV disks Date: Thu, 27 Jun 2013 18:50:00 +0100 Message-ID: References: <20940.26172.875919.504123@mariner.uk.xensource.com> <20940.31210.191976.244639@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20940.31210.191976.244639@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: xen-devel@lists.xensource.com, Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thu, 27 Jun 2013, Ian Jackson wrote: > Stefano Stabellini writes ("Re: [PATCH v2] introduce a cache options for PV disks"): > > It's mostly OK, just few minor corrections for code readability > > Thanks. > > > > int info = 0; > > > + char *directiosafe == NULL; > > ^ = > > I did warn that I hadn't compiled it :-). > > > > out_error: > > > @@ -773,6 +779,7 @@ out_error: > > > blkdev->dev = NULL; > > > g_free(blkdev->devtype); > > > blkdev->devtype = NULL; > > > + g_free(directiosafe); > > > > maybe add > > > > blkdev->directiosafe = false; > > Sure, does no harm. > > > > + if (blkdev->directiosafe) { > > > + qflags = BDRV_O_NOCACHE | BDRV_O_NATIVE_AIO; > > > + } > > > > Please change this into: > > > > if (blkdev->directiosafe) { > > qflags = BDRV_O_NOCACHE | BDRV_O_NATIVE_AIO; > > } else { > > qflags = BDRV_O_CACHE_WB; > > } > > I don't think that can be right. The result would be that the value > non-directiosafe value of qflags is changed. But I will break it > apart as you suggest. BDRV_O_NATIVE_AIO is ignored if BDRV_O_NOCACHE is not also set, so there would be not behavioural change. However the code would be clearer.