]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/read_record.c
- Implement first cut of Migration.
[bacula/bacula] / bacula / src / stored / read_record.c
index 3f8f9a386bccb1f20b146448ff76a3dcfe080a5e..c6e77c0f1aff0883a1721881e81a33bbbfa43a58 100644 (file)
@@ -14,7 +14,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -157,7 +157,7 @@ bool read_records(DCR *dcr,
       record = 0;
       rec->state = 0;
       Dmsg1(300, "Block empty %d\n", is_block_empty(rec));
-      for (rec->state=0; !is_block_empty(rec); ) {
+      for (rec->state=0; ok && !is_block_empty(rec); ) {
          if (!read_record_from_block(block, rec)) {
             Dmsg3(400, "!read-break. state=%s blk=%d rem=%d\n", rec_state_to_str(rec),
                   block->BlockNumber, rec->remainder);
@@ -205,7 +205,7 @@ bool read_records(DCR *dcr,
                Dmsg2(300, "All done=(file:block) %u:%u\n", dev->file, dev->block_num);
                break;
             } else if (stat == 0) {  /* no match */
-               Dmsg4(300, "Clear rem=%d FI=%d before set_eof pos %u:%u\n",
+               Dmsg4(300, "BSR no match: clear rem=%d FI=%d before set_eof pos %u:%u\n",
                   rec->remainder, rec->FileIndex, dev->file, dev->block_num);
                rec->remainder = 0;
                rec->state &= ~REC_PARTIAL_RECORD;
@@ -215,6 +215,7 @@ bool read_records(DCR *dcr,
                continue;              /* we don't want record, read next one */
             }
          }
+         dcr->VolLastIndex = rec->FileIndex;  /* let caller know where we are */
          if (is_partial_record(rec)) {
             Dmsg6(300, "Partial, break. recno=%d state=%s blk=%d SI=%d ST=%d FI=%d\n", record,
                rec_state_to_str(rec), block->BlockNumber,