]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/dev.c
Merge branch 'master' of ssh://bacula.git.sourceforge.net/gitroot/bacula/bacula
[bacula/bacula] / bacula / src / stored / dev.c
index f6db91c261bdb8f72a447e94ee17206f5ea76d7d..2535dfc5c52098efc5f3ba3924ec235fad7d7b6f 100644 (file)
@@ -267,6 +267,10 @@ init_dev(JCR *jcr, DEVRES *device)
       Mmsg1(dev->errmsg, _("Unable to init mutex: ERR=%s\n"), be.bstrerror(errstat));
       Jmsg0(jcr, M_ERROR_TERM, 0, dev->errmsg);
    }
+   /* Ensure that we respect this order in P/V operations */
+   bthread_mutex_set_priority(&dev->m_mutex,       PRIO_SD_DEV_ACCESS);
+   bthread_mutex_set_priority(&dev->spool_mutex,   PRIO_SD_DEV_SPOOL);
+   bthread_mutex_set_priority(&dev->acquire_mutex, PRIO_SD_DEV_ACQUIRE);
 #ifdef xxx
    if ((errstat = rwl_init(&dev->lock)) != 0) {
       berrno be;
@@ -2164,7 +2168,7 @@ bool DEVICE::do_tape_mount(int mount, int dotimeout)
       /* Try at most 10 times to (un)mount the device. This should perhaps be configurable. */
       tries = 10;
    } else {
-      tries = 0;
+      tries = 1;
    }
    results = get_memory(4000);
 
@@ -2222,7 +2226,7 @@ bool DEVICE::do_file_mount(int mount, int dotimeout)
       /* Try at most 10 times to (un)mount the device. This should perhaps be configurable. */
       tries = 10;
    } else {
-      tries = 0;
+      tries = 1;
    }
    results = get_memory(4000);