]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
storage: Wait udev events are handled before removing lvm vol
authorOsier Yang <jyang@redhat.com>
Wed, 21 Sep 2011 06:02:30 +0000 (14:02 +0800)
committerOsier Yang <jyang@redhat.com>
Wed, 21 Sep 2011 23:53:57 +0000 (07:53 +0800)
commitbc4e5b43c28fe8b2032fcd14ec661c4627df3b74
tree64acc731ffaec077d893c40aa40daa4c38dc9a7d
parentd93a08eb47e248b165e1fa80d5198a91f9ca9e40
storage: Wait udev events are handled before removing lvm vol

Related #BZ: https://bugzilla.redhat.com/show_bug.cgi?id=702260.

There are two problems described in the BZ:
1) "Can't remove open logical volume".
2) "Unable to deactivate logical volume "foo""

This patch just intends to fix 2), as 1) is expected if the vol
is still used by something, and you never known if "lvchange -an"
will fail or not either (sometime, it will succeed, sometimes not).
We'd better not look for trouble, :-)

For 2), that's caused by race between lvremove and udev event handling,
the only workable way now is to wait the events handling are finished,
though it might introduce latencies, as "udevadmin settle" exits
after *all* events are handled, it's the only way we can fix
the racing in libvirt layer.

See https://bugzilla.redhat.com/show_bug.cgi?id=570359 for more
details.
src/storage/storage_backend_logical.c