Fix gparted scans forever blank disk in virtual machine (#697518)

In some circumstances gparted would appear to scan forever if it
encountered a blank hard disk.  This would happen if the timing of
events was right and gparted encountered a disk without a partition
table.  The missing partition table would cause a call to the
exception handler, which could get stuck in a thread waiting position.

The problem was traced back to the ped_exception_handler
and a cond.signal() call missing the requisite mutex.lock() and
mutex.unlock() around the signal call.

Closes Bug #697518 - gparted scans forever blank disk in virtualbox
This commit is contained in:
Curtis Gedak 2013-04-18 13:20:05 -06:00 committed by Mike Fleetwood
parent 17a51ba622
commit 51b8e241bc
1 changed files with 2 additions and 0 deletions

View File

@ -3502,7 +3502,9 @@ static bool _ped_exception_handler( struct ped_exception_ctx *ctx )
if( optcount == 1 && ctx->e->type != PED_EXCEPTION_BUG && ctx->e->type != PED_EXCEPTION_FATAL )
{
ctx->ret = (PedExceptionOption)opt;
ctx->mutex.lock();
ctx->cond.signal();
ctx->mutex.unlock();
return false;
}
PedExceptionMsg msg( *ctx->e );