From 85cce963b2dccb012de6ea4950634d630b6d9c11 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 13 Sep 2007 15:13:10 +0000 Subject: [PATCH] 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 --- bacula/src/stored/acquire.c | 9 ++++++++- bacula/technotes-2.3 | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) 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. -- 2.39.5