]> git.sur5r.net Git - bacula/bacula/commitdiff
Merge branch 'mvw/xattr-overhaul'
authorMarco van Wieringen <mvw@planets.elm.net>
Fri, 16 Oct 2009 08:17:23 +0000 (10:17 +0200)
committerMarco van Wieringen <mvw@planets.elm.net>
Fri, 16 Oct 2009 08:17:23 +0000 (10:17 +0200)
bacula/src/stored/acquire.c
bacula/src/stored/bextract.c
bacula/src/stored/reserve.c
bacula/src/version.h
bacula/technotes
regress/tests/fileregexp-test

index 1d382d1f58f36b1d36e743ff537088a45a590653..1458fb67c2397ad93bf8b6aba0c895cc7e205395 100644 (file)
@@ -63,7 +63,8 @@ bool acquire_device_for_read(DCR *dcr)
    int vol_label_status;
    int retry = 0;
    
-   Dmsg1(950, "jcr->dcr=%p\n", jcr->dcr);
+   Dmsg2(950, "dcr=%p dev=%p\n", dcr, dcr->dev);
+   Dmsg2(950, "MediaType dcr=%s dev=%s\n", dcr->media_type, dev->device->media_type);
    dev->dblock(BST_DOING_ACQUIRE);
 
    if (dev->num_writers > 0) {
@@ -123,6 +124,7 @@ bool acquire_device_for_read(DCR *dcr)
       lock_reservations();
       memset(&rctx, 0, sizeof(RCTX));
       rctx.jcr = jcr;
+      jcr->read_dcr = dcr;
       jcr->reserve_msgs = New(alist(10, not_owned_by_alist));
       rctx.any_drive = true;
       rctx.device_name = vol->device;
@@ -166,6 +168,7 @@ bool acquire_device_for_read(DCR *dcr)
          goto get_out;
       }
    }
+   Dmsg2(400, "MediaType dcr=%s dev=%s\n", dcr->media_type, dev->device->media_type);
 
    dev->clear_unload();
 
@@ -332,7 +335,8 @@ get_out:
    } else {
       dev->dunlock();               /* dunblock() unlock the device too */
    }
-   Dmsg1(950, "jcr->dcr=%p\n", jcr->dcr);
+   Dmsg2(950, "dcr=%p dev=%p\n", dcr, dcr->dev);
+   Dmsg2(950, "MediaType dcr=%s dev=%s\n", dcr->media_type, dev->device->media_type);
    return ok;
 }
 
index 5786a4c133d26b45c19a1749bc9013d760a47759..b96f7dfd663117bfdc22f0b864edb87427105293 100644 (file)
@@ -443,7 +443,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
                                  (const Byte *)wbuf, (uLong)wsize)) == Z_BUF_ERROR)
          {
             /* The buffer size is too small, try with a bigger one */
-            compress_len = compress_len + compress_len >> 1;
+            compress_len = compress_len + (compress_len >> 1);
             compress_buf = check_pool_memory_size(compress_buf,
                                                   compress_len);
          }
index 2a1f3031f5ee2e74ddaa80b67714c0a9a20904e1..677d5ebdeab4ce055ae03d37e0caca07983d0cef 100644 (file)
@@ -634,7 +634,11 @@ static int reserve_device(RCTX &rctx)
 
    rctx.suitable_device = true;
    Dmsg1(dbglvl, "try reserve %s\n", rctx.device->hdr.name);
-   dcr = new_dcr(rctx.jcr, rctx.jcr->dcr, rctx.device->dev);
+   if (rctx.store->append) {
+      dcr = new_dcr(rctx.jcr, rctx.jcr->dcr, rctx.device->dev);
+   } else {
+      dcr = new_dcr(rctx.jcr, rctx.jcr->read_dcr, rctx.device->dev);
+   }
    if (!dcr) {
       BSOCK *dir = rctx.jcr->dir_bsock;
       dir->fsend(_("3926 Could not get dcr for device: %s\n"), rctx.device_name);
index e35bd1aa15343bfce43ea7c1ffba7c2a63a2845b..6d9590fb126b8d2efc7e170b7f85728056824e99 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "3.1.4"
-#define BDATE   "12 October 2009"
-#define LSMDATE "12Oct09"
+#define BDATE   "16 October 2009"
+#define LSMDATE "16Oct09"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2009 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2009"       /* year for copyright messages in progs */
index 10a3cb06ac8709ee388a65939aed2b74159d4fd0..d694e62043dacf1e778149756e4bbd87d6ce8218 100644 (file)
@@ -2,6 +2,8 @@
           
 General:
 
+16Oct09
+kes  Fix switching read device reported by Nicolae Mihalache <mache@abcpages.com>
 15Oct09
 kes  Fix bug #1391 Job status improperly set due to subtle variable overload problem
 13Oct09
index b935f25385aa67ad5795dc95813da20f874e178d..e4dbe2678612f0423ad6341e65b96be2ac303666 100755 (executable)
@@ -51,11 +51,18 @@ run_bacula
 check_for_zombie_jobs storage=File
 stop_bacula
 
+#
+# The above restore should have restored some directories, but only
+# files that have README in their name.  There should in fact, be
+# no other files restored COUNT_OTHER==0 and 13 README files restored.
+# We complain if there are less than 11
+#
 COUNT_OTHER=`find ${tmp}/bacula-restores -type f | grep -v README | wc -l`
 COUNT_README=`find ${tmp}/bacula-restores -type f | grep README | wc -l`
 
 if [ $COUNT_OTHER -gt 0 -o $COUNT_README -lt 11 ]; then
     print_debug "Found non matching files"
+    print debug "Count_other=$COUNT_OTHER count_readme=$COUNT_README"
     print_debug `find ${tmp}/bacula-restores -type f | grep -v README`
     rstat=2
 fi