[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] fstrim & upstream kernel not working
From: |
Richard W.M. Jones |
Subject: |
Re: [Qemu-devel] fstrim & upstream kernel not working |
Date: |
Fri, 14 Mar 2014 13:34:19 +0000 |
User-agent: |
Mutt/1.5.20 (2009-12-10) |
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