From: Eric Bollengier Date: Wed, 6 Jul 2011 14:43:42 +0000 (+0200) Subject: Fix deadlock with autochanger X-Git-Tag: Release-7.0.0~881 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0780c898160fb907afcb6c89b88a3b4324e85345;p=bacula%2Fbacula Fix deadlock with autochanger --- diff --git a/bacula/src/stored/autochanger.c b/bacula/src/stored/autochanger.c index b63a585b18..3d38739f44 100644 --- a/bacula/src/stored/autochanger.c +++ b/bacula/src/stored/autochanger.c @@ -405,10 +405,14 @@ bool unload_autochanger(DCR *dcr, int loaded) dev->set_slot(0); /* nothing loaded */ } - free_volume(dev); /* Free any volume associated with this drive */ free_pool_memory(changer); } unlock_changer(dcr); + + if (loaded > 0) { /* free_volume outside from changer lock */ + free_volume(dev); /* Free any volume associated with this drive */ + } + if (ok) { dev->clear_unload(); }