qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Lieven <pl@kamp.de>
To: Jeff Cody <jcody@redhat.com>
Cc: qemu-block@nongnu.org, ronniesahlberg@gmail.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] block/nfs: refuse readahead if cache.direct is on
Date: Thu, 19 May 2016 08:03:17 +0200	[thread overview]
Message-ID: <573D5725.9000205@kamp.de> (raw)
In-Reply-To: <20160518132801.GB3668@localhost.localdomain>

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 <pl@kamp.de>
>> ---
>>   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	other threads:[~2016-05-19  6:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17 14:11 [Qemu-devel] [PATCH 0/2] block/nfs: add support for libnfs pagecache Peter Lieven
2016-05-17 14:11 ` [Qemu-devel] [PATCH 1/2] " Peter Lieven
2016-05-17 14:11 ` [Qemu-devel] [PATCH 2/2] block/nfs: refuse readahead if cache.direct is on Peter Lieven
2016-05-18 13:28   ` Jeff Cody
2016-05-19  6:03     ` Peter Lieven [this message]
2016-05-18  7:45 ` [Qemu-devel] [PATCH 0/2] block/nfs: add support for libnfs pagecache Fam Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=573D5725.9000205@kamp.de \
    --to=pl@kamp.de \
    --cc=jcody@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=ronniesahlberg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).