summaryrefslogtreecommitdiff
path: root/bootstrap.conf
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-04-30 12:28:16 +0200
committerJim Meyering <meyering@redhat.com>2010-04-30 16:20:19 +0200
commit0f850220b3f26bb969a1a7ff78dc550691a89566 (patch)
tree8b75013c989da9e8c3d47b3947423ffa5f46f79b /bootstrap.conf
parent9acc5869985c8616066af4825f52fb6c474f63dd (diff)
downloadparted-0f850220b3f26bb969a1a7ff78dc550691a89566.tar.gz
libparted: avoid race in informing the kernel of partition table changes
When sync'ing a partition table change using the latest code, sometimes we'd get an unwarranted failure like this: Warning: Partition(s) 1 on /dev/sdd have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. To be precise, when running the partition-resizing root-only test in a loop: for i in $(seq 240); do make -C tests check VERBOSE=yes \ TESTS=t3000-resize-fs.sh >& log.$i && printf . || echo $i $?; done I would typically see about 50% of them fail on a Fedora 13 system. It was obvious that this was due to a race condition when I found that modifying that tests' parted...resize invocation to go via strace changed the timing enough to make the test pass every time. The fix is to retry the partition-removal step upon any EBUSY failure, currently for up to 1 second (retrying up to 100 times, sleeping 10ms after each failure). * libparted/arch/linux.c (_disk_sync_part_table): Allocate "ok" using calloc, now that its initial values matter. Retry each removal upon EBUSY-failure. * bootstrap.conf (gnulib_modules): Use gnulib's usleep module.
Diffstat (limited to 'bootstrap.conf')
-rw-r--r--bootstrap.conf1
1 files changed, 1 insertions, 0 deletions
diff --git a/bootstrap.conf b/bootstrap.conf
index 6c9287d..4ca51a7 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -58,6 +58,7 @@ gnulib_modules="
unlink
update-copyright
useless-if-before-free
+ usleep
vc-list-files
version-etc-fsf
warnings