backport r1092788: workaround a libparted commit_to_os bug.

svn path=/branches/partitionmanager/1.0/partitionmanager/; revision=1092791
This commit is contained in:
Volker Lanz 2010-02-19 14:46:25 +00:00
parent 867027eeb8
commit 655656cbae
1 changed files with 15 additions and 1 deletions

View File

@ -101,7 +101,21 @@ bool Job::commit(PedDisk* disk, quint32 timeout)
bool rval = ped_disk_commit_to_dev(disk);
rval = ped_disk_commit_to_os(disk) && rval;
// The GParted authors have found a bug in libparted that causes it to intermittently
// not commit changes to the Linux kernel, probably a race. Until this is fixed in
// libparted, the following patch should help alleviate the consequences by just re-trying
// committing to the OS if it fails the first time after a short pause.
// See: http://git.gnome.org/browse/gparted/commit/?id=bf86fd3f9ceb0096dfe87a8c9a38403c13b13f00
if (rval)
{
rval = ped_disk_commit_to_os(disk);
if (!rval)
{
sleep(1);
rval = ped_disk_commit_to_os(disk);
}
}
if (!ExternalCommand("udevadm", QStringList() << "settle" << "--timeout=" + QString::number(timeout)).run() &&
!ExternalCommand("udevsettle", QStringList() << "--timeout=" + QString::number(timeout)).run())