]> git.sur5r.net Git - bacula/bacula/commitdiff
Add mutex priority check for changer mutex
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 6 Jul 2011 14:45:37 +0000 (16:45 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:04 +0000 (14:49 +0200)
bacula/src/lib/mutex_list.h
bacula/src/stored/stored_conf.c

index 47ec077d5a22be21190007b595eb6d009ed526e0..b3f51a2ef39faba0b80cef40fc78ded9ed6f7af5 100644 (file)
@@ -39,5 +39,6 @@
 #define PRIO_SD_VOL_LIST      10           /* vol_list_lock */
 #define PRIO_SD_READ_VOL_LIST 12           /* read_vol_list */
 #define PRIO_SD_DEV_SPOOL     14           /* dev.spool_mutex */
+#define PRIO_SD_ACH_ACCESS    16           /* autochanger lock mutex */
 
 #endif
index a9fc44da5df02288e5bee45849b790a2694c0e6f..c15e8a9fb1fa5406963a9b533ff79c839a0b5874 100644 (file)
@@ -630,7 +630,9 @@ void save_resource(int type, RES_ITEM *items, int pass)
          foreach_alist(dev, res->res_changer.device) {
             dev->changer_res = (AUTOCHANGER *)&res->res_changer;
          }
-         if ((errstat = rwl_init(&res->res_changer.changer_lock)) != 0) {
+         if ((errstat = rwl_init(&res->res_changer.changer_lock, 
+                                 PRIO_SD_ACH_ACCESS)) != 0)
+         {
             berrno be;
             Jmsg1(NULL, M_ERROR_TERM, 0, _("Unable to init lock: ERR=%s\n"), 
                   be.bstrerror(errstat));