From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3H3V-0000J7-99 for qemu-devel@nongnu.org; Thu, 19 May 2016 02:03:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3H3J-0005Uh-8M for qemu-devel@nongnu.org; Thu, 19 May 2016 02:03:32 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:55019 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3H3I-0005UR-V0 for qemu-devel@nongnu.org; Thu, 19 May 2016 02:03:21 -0400 References: <1463494315-12578-1-git-send-email-pl@kamp.de> <1463494315-12578-3-git-send-email-pl@kamp.de> <20160518132801.GB3668@localhost.localdomain> From: Peter Lieven Message-ID: <573D5725.9000205@kamp.de> Date: Thu, 19 May 2016 08:03:17 +0200 MIME-Version: 1.0 In-Reply-To: <20160518132801.GB3668@localhost.localdomain> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] block/nfs: refuse readahead if cache.direct is on List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: qemu-block@nongnu.org, ronniesahlberg@gmail.com, qemu-devel@nongnu.org Am 18.05.2016 um 15:28 schrieb Jeff Cody: > On Tue, May 17, 2016 at 04:11:55PM +0200, Peter Lieven wrote: >> Signed-off-by: Peter Lieven >> --- >> block/nfs.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/block/nfs.c b/block/nfs.c >> index 975510f..8b73a35 100644 >> --- a/block/nfs.c >> +++ b/block/nfs.c >> @@ -331,6 +331,11 @@ static int64_t nfs_client_open(NFSClient *client, const char *filename, >> nfs_set_tcp_syncnt(client->context, val); >> #ifdef LIBNFS_FEATURE_READAHEAD >> } else if (!strcmp(qp->p[i].name, "readahead")) { >> + if (open_flags & BDRV_O_NOCACHE) { >> + error_setg(errp, "Cannot enable NFS readahead " >> + "if cache.direct = on"); >> + goto fail; >> + } >> if (val > QEMU_NFS_MAX_READAHEAD_SIZE) { >> error_report("NFS Warning: Truncating NFS readahead" >> " size to %d", QEMU_NFS_MAX_READAHEAD_SIZE); >> -- >> 1.9.1 >> > Do we to check for cache mode changes now in nfs_reopen_prepare()? Good point. I guess I have to error out in bdrv_reopen_prepare if we change the cache.direct from off to on and have readahead or pagecache enabled. Will send an update. Thanks, Peter