qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH 2/2] block/nfs: refuse readahead if cache.direct


From: Peter Lieven
Subject: Re: [Qemu-block] [PATCH 2/2] block/nfs: refuse readahead if cache.direct is on
Date: Thu, 19 May 2016 08:03:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

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 <address@hidden>
---
  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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]