]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/2.4.0-sd-deadlock.patch
54ca518d931361d0913b390e7d65ffbca8eb77fb
[bacula/bacula] / bacula / patches / 2.4.0-sd-deadlock.patch
1
2  This patch should fix a volume locking deadlock condition in the 
3  Storage daemon as  reported in bug #1100.
4
5  Apply it to version 2.4.0 with:
6
7  cd <bacula-source>
8  patch -p0 <2.4.0-sd-deadlock.patch
9  ./configure <your-options>
10  make
11  ...
12  make install
13
14
15 Index: src/stored/mount.c
16 ===================================================================
17 --- src/stored/mount.c  (revision 7204)
18 +++ src/stored/mount.c  (working copy)
19 @@ -179,9 +179,13 @@
20     }
21     Dmsg2(150, "Ask=%d autochanger=%d\n", ask, autochanger);
22  
23 -   if (ask && !dir_ask_sysop_to_mount_volume(dcr, ST_APPEND)) {
24 -      Dmsg0(150, "Error return ask_sysop ...\n");
25 -      goto bail_out;          /* error return */
26 +   if (ask) {
27 +      unlock_volumes();
28 +      if (!dir_ask_sysop_to_mount_volume(dcr, ST_APPEND)) {
29 +         Dmsg0(150, "Error return ask_sysop ...\n");
30 +         goto no_lock_bail_out;  /* error return */
31 +      }
32 +      lock_volumes();
33     }
34     if (job_canceled(jcr)) {
35        goto bail_out;