1
0
mirror of synced 2026-01-28 04:27:38 +00:00

Work around LVM related race condition when using --force with LVM

If an "lvremove" is immediately followed by an "lvcreate" for an LV
with the same name, "mkswap" (and maybe other commands) occasionally
fail with "Device or resource busy".

Work around it by using sync and sleep.
This commit is contained in:
Axel Beckert
2017-01-17 18:46:39 +01:00
parent 9c0086120f
commit d315f17eff
3 changed files with 10 additions and 0 deletions

View File

@@ -23,6 +23,11 @@ Bug Fixes
Thanks Santiago Vila for the bug report and patch! (Closes Debian
bug report #764625)
* Fixes typo found by Lintian.
* Work around LVM related race condition when using --force with LVM:
If an "lvremove" is immediately followed by an "lvcreate" for an LV
with the same name, "mkswap" (and maybe other commands) occasionally
fail with "Device or resource busy". Work around it by using sync
and sleep.
Distribution Releases Changes
-----------------------------

View File

@@ -3066,6 +3066,10 @@ sub createLVMBits
logprint(
"Removing $lvm_disk - since we're forcing the install\n");
runCommand("lvremove --force $lvm_disk", \%CONFIG);
runCommand("sync", \%CONFIG);
logprint(
"Sleeping a few seconds to avoid LVM race conditions...\n");
sleep(3);
} else {
fail("ERROR: Xen guest $CONFIG{'hostname'} appears to be running.\nAborting.\n");
}

1
debian/changelog vendored
View File

@@ -21,6 +21,7 @@ xen-tools (4.6.3~dev-1) UNRELEASED; urgency=medium
+ Support situations where distributions (e.g. Squeeze) might be EoL,
but its archive signing key is still not removed from the default
keyring.
+ Workaround LVM related race condition when using --force with LVM.
* Declare compliance with Debian Policy 3.9.8. (No changes needed.)
* Use NEWS.markdown as upstream changelog, don't install it as docs.
* Switch many URLs (upstream and in packaging) to https:// and update