From: Kern Sibbald Date: Thu, 13 Sep 2007 15:13:10 +0000 (+0000) Subject: kes Fix seg fault in error exit of acquire_for_read after unsuccessfully X-Git-Tag: Release-3.0.0~2528 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6c3b287bb510b1d88b76105cb2bf92d60494b8a5;p=bacula%2Fbacula kes Fix seg fault in error exit of acquire_for_read after unsuccessfully trying to switch drives by checking for blocking before unblocking. Fixes bug #906. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5545 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index 5736d70334..9bb22a7809 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -292,7 +292,14 @@ get_out: Dmsg2(50, "Dec reserve=%d dev=%s\n", dev->reserved_device, dev->print_name()); dcr->reserved_device = false; } - dev->dunblock(DEV_LOCKED); + /* + * Normally we are blocked, but in at least one error case above + * we are not blocked because we unsuccessfully tried changing + * devices. + */ + if (dev->is_blocked()) { + dev->dunblock(DEV_LOCKED); + } Dmsg1(950, "jcr->dcr=%p\n", jcr->dcr); return ok; } diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 8154946c41..4ce2834e95 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -2,6 +2,9 @@ General: 13Sep07 +kes Fix seg fault in error exit of acquire_for_read after unsuccessfully + trying to switch drives by checking for blocking before unblocking. + Fixes bug #906. kes Cancel storage daemon in all cases where FD reports error. This should fix virtually all cases of bug #920. kes Fix db_escape_string() for MySQL which did not compile.