qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: kwolf@redhat.com, Peter Lieven <pl@kamp.de>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCHv2] block/nfs: cache allocated filesize for read-only files
Date: Wed, 26 Aug 2015 11:31:17 -0400	[thread overview]
Message-ID: <20150826153117.GH11016@localhost.localdomain> (raw)
In-Reply-To: <55DB7ADC.1010109@redhat.com>

On Mon, Aug 24, 2015 at 10:13:16PM +0200, Max Reitz wrote:
> On 24.08.2015 21:34, Peter Lieven wrote:
> > Am 24.08.2015 um 20:39 schrieb Max Reitz:
> >> On 24.08.2015 10:06, Peter Lieven wrote:
> >>> If the file is readonly its not expected to grow so
> >>> save the blocking call to nfs_fstat_async and use
> >>> the value saved at connection time. Also important
> >>> the monitor (and thus the main loop) will not hang
> >>> if block device info is queried and the NFS share
> >>> is unresponsive.
> >>>
> >>> Signed-off-by: Peter Lieven <pl@kamp.de>
> >>> ---
> >>> v1->v2: update cache on reopen_prepare [Max]
> >>>
> >>>  block/nfs.c | 35 +++++++++++++++++++++++++++++++++++
> >>>  1 file changed, 35 insertions(+)
> >> Reviewed-by: Max Reitz <mreitz@redhat.com>
> >>
> >> I hope you're ready for the "Stale actual-size value with
> >> cache=direct,read-only=on,format=raw files on NFS" reports. :-)
> > actually a good point, maybe the cache should only be used if
> > 
> > !(bs->open_flags & BDRV_O_NOCACHE)
> 
> Good enough a point to fix it? ;-)
> 
> Max
> 

It seems more inline with expected behavior, to add the cache checking
in before using the size cache.  Would you be opposed to a v3 with
this check added in?

One other concern I have is similar to a concern Max raised earlier -
about an external program modifying the raw image, while QEMU has it
opened r/o.  In particular, I wonder about an NFS server making an
image either sparse / non-sparse.  If it was exported read-only, it
may be a valid assumption that this could be done safely, as it would
not change the reported file size or contents, just the allocated size
on disk.

  reply	other threads:[~2015-08-26 15:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24  8:06 [Qemu-devel] [PATCHv2] block/nfs: cache allocated filesize for read-only files Peter Lieven
2015-08-24 18:39 ` Max Reitz
2015-08-24 19:34   ` Peter Lieven
2015-08-24 20:13     ` Max Reitz
2015-08-26 15:31       ` Jeff Cody [this message]
2015-08-26 18:49         ` Peter Lieven
2015-08-26 19:14           ` Jeff Cody
2015-09-03 17:05             ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi

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=20150826153117.GH11016@localhost.localdomain \
    --to=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).