From patchwork Tue May 17 14:11:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 9116221 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6D1A29F1C1 for ; Wed, 18 May 2016 05:34:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D0A9F20279 for ; Wed, 18 May 2016 05:34:11 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7A003201ED for ; Wed, 18 May 2016 05:34:10 +0000 (UTC) Received: from localhost ([::1]:43038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2u7V-0007Nz-HS for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 May 2016 01:34:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2u74-0007Ka-Sc for qemu-devel@nongnu.org; Wed, 18 May 2016 01:33:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2u6y-0001aE-W3 for qemu-devel@nongnu.org; Wed, 18 May 2016 01:33:41 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:52198 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2u6y-0001Zj-Ly for qemu-devel@nongnu.org; Wed, 18 May 2016 01:33:36 -0400 Received: (qmail 27868 invoked by uid 89); 18 May 2016 05:33:32 -0000 Received: from [195.62.97.28] by client-16-kamp (envelope-from , uid 89) with qmail-scanner-2010/03/19-MF (clamdscan: 0.99.2/21564. hbedv: 8.3.40.10/7.12.91.128. avast: 1.2.2/16051703. spamassassin: 3.4.1. Clear:RC:1(195.62.97.28):. Processed in 0.203168 secs); 18 May 2016 05:33:32 -0000 Received: from smtp.kamp.de (HELO submission.kamp.de) ([195.62.97.28]) by mx01.kamp.de with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted); 18 May 2016 05:33:30 -0000 X-GL_Whitelist: yes Received: (qmail 6279 invoked from network); 18 May 2016 05:33:29 -0000 Received: from lieven-pc.kamp-intra.net (HELO lieven-pc) (relay@kamp.de@::ffff:172.21.12.60) by submission.kamp.de with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted) ESMTPA; 18 May 2016 05:33:29 -0000 Received: by lieven-pc (Postfix, from userid 1000) id 78D4C20D7E; Tue, 17 May 2016 16:12:04 +0200 (CEST) From: Peter Lieven To: qemu-block@nongnu.org Date: Tue, 17 May 2016 16:11:55 +0200 Message-Id: <1463494315-12578-3-git-send-email-pl@kamp.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463494315-12578-1-git-send-email-pl@kamp.de> References: <1463494315-12578-1-git-send-email-pl@kamp.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a02:248:0:51::16 Subject: [Qemu-devel] [PATCH 2/2] block/nfs: refuse readahead if cache.direct is on X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jcody@redhat.com, Peter Lieven , qemu-devel@nongnu.org, ronniesahlberg@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);