Received: from eggs.gnu.org ([2001:4830:134:3::10]:49607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b31WJ-0006xT-BY for qemu-devel@nongnu.org; Wed, 18 May 2016 09:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b31WH-000528-DS for qemu-devel@nongnu.org; Wed, 18 May 2016 09:28:14 -0400 Date: Wed, 18 May 2016 09:28:01 -0400 From: Jeff Cody Message-ID: <20160518132801.GB3668@localhost.localdomain> References: <1463494315-12578-1-git-send-email-pl@kamp.de> <1463494315-12578-3-git-send-email-pl@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1463494315-12578-3-git-send-email-pl@kamp.de> 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: Peter Lieven Cc: qemu-block@nongnu.org, ronniesahlberg@gmail.com, qemu-devel@nongnu.org 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()?