qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] fstrim & upstream kernel not working
Date: Fri, 14 Mar 2014 13:34:19 +0000	[thread overview]
Message-ID: <20140314133419.GT1346@redhat.com> (raw)
In-Reply-To: <532303F8.8010705@redhat.com>

On Fri, Mar 14, 2014 at 02:28:24PM +0100, Paolo Bonzini wrote:
> Il 14/03/2014 14:24, Richard W.M. Jones ha scritto:
> >>> Could be a race condition (something going on in the background
> >>> between rm and fstrim).
> >Not much happens in the libguestfs appliance.  There are usually only
> >two processes (udev + guestfsd).
> 
> There's also the kernel.  The ext4 driver is probably doing
> something after rm returns, and hasn't finished yet when you invoke
> FITRIM.

Yup.  libguestfs has exposed a number of places where you can type
commands slowly by hand, but running them from a script would fail.
Check out the number of places we call 'udevadm --settle' or 'sync' --
each one has been discovered painfully over 5 years.

$ git grep -E 'udev_settle|sync_disks' daemon | wc -l
59

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top

      reply	other threads:[~2014-03-14 13:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-13 21:49 [Qemu-devel] fstrim & upstream kernel not working Richard W.M. Jones
2014-03-14 12:30 ` Paolo Bonzini
2014-03-14 12:42   ` Richard W.M. Jones
2014-03-14 12:47     ` Paolo Bonzini
2014-03-14 13:24       ` Richard W.M. Jones
2014-03-14 13:28         ` Paolo Bonzini
2014-03-14 13:34           ` Richard W.M. Jones [this message]

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=20140314133419.GT1346@redhat.com \
    --to=rjones@redhat.com \
    --cc=pbonzini@redhat.com \
    --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).