]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix Verify job issue with offset stream and compressed blocks
authorEric Bollengier <eric@baculasystems.com>
Tue, 23 Feb 2021 09:01:38 +0000 (10:01 +0100)
committerEric Bollengier <eric@baculasystems.com>
Fri, 26 Mar 2021 13:57:58 +0000 (14:57 +0100)
Description:
------------

When a Plugin generates an OFFSET stream and the FileSet uses
data compression, a Verify job (level=data) did not handle
correctly the offset header in the data stream, resulting
the following kind of message:

  Error: Compressed header version error. Got=0x4f58 want=0x1

bacula/src/filed/verify_vol.c

index 754c3f4a7c5af024a1ccd5447ed2a39f8a71c169..9876ea67eeb0003b9b7f4c80364d1de87922c6dd 100644 (file)
@@ -187,6 +187,7 @@ void v_ctx::skip_sparse_header(char **data, uint32_t *length)
    
    *data += OFFSET_FADDR_SIZE;
    *length -= OFFSET_FADDR_SIZE;
+   Dmsg0(0, "Skipping SPARSE HEADER\n");
 }
 
 void v_ctx::check_accurate()
@@ -310,7 +311,7 @@ void do_verify_volume(JCR *jcr)
          goto bail_out;
       }
       vctx.stream = vctx.full_stream & STREAMMASK_TYPE;
-      Dmsg4(30, "Got hdr: FilInx=%d FullStream=%d Stream=%d size=%d.\n",
+      Dmsg4(0, "Got hdr: FilInx=%d FullStream=%d Stream=%d size=%d.\n",
             file_index, vctx.full_stream, vctx.stream, size);
 
       /*
@@ -504,7 +505,8 @@ void do_verify_volume(JCR *jcr)
 
             if (vctx.stream == STREAM_SPARSE_DATA
                 || vctx.stream == STREAM_SPARSE_COMPRESSED_DATA
-                || vctx.stream == STREAM_SPARSE_GZIP_DATA) {
+                || vctx.stream == STREAM_SPARSE_GZIP_DATA
+                || vctx.full_stream & STREAM_BIT_OFFSETS) {
                vctx.skip_sparse_header(&wbuf, &wsize);
             }