From: Alain Spineux Date: Thu, 10 Aug 2023 13:41:01 +0000 (+0200) Subject: Fix ZSTD compression level ignored in FileSet X-Git-Tag: Beta-15.0.0~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=184f69772627366c79cea5fb8522571974caec49;p=thirdparty%2Fbacula.git Fix ZSTD compression level ignored in FileSet - before all ZSTD* where enabling ZSTD level 10 now all ZSTD* match there own level and ZSTD match ZSTD10 - embellish the code --- diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index dac29f88c..dcea6fea3 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -227,8 +227,9 @@ bool blast_data_to_storage_daemon(JCR *jcr, char *addr) #ifdef HAVE_ZSTD ZSTD_freeCCtx((ZSTD_CCtx*)jcr->ZSTD_compress_workset); + jcr->ZSTD_compress_workset = NULL; #endif - + crypto_session_end(jcr); bdelete_and_null(jcr->sd_packet_mgr); @@ -1543,7 +1544,7 @@ static bool do_zstd_compression(bctx_t &bctx) size_t ret = ZSTD_compressCCtx((ZSTD_CCtx*) jcr->ZSTD_compress_workset, bctx.cbuf2, bctx.max_compress_len, bctx.rbuf, sd->msglen, - 10); + bctx.ff_pkt->Compress_level); if (ZSTD_isError(ret)) { /** this should NEVER happen */ diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index d7f2d14c0..c0d9f3db3 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -2099,6 +2099,8 @@ static int set_options(findFOPTS *fo, const char *opts) fo->Compress_level = 10; break; } + } else { + Dmsg1(10, "Ignore unknown compression code Z%c in the FileSet\n", *p); } break; case 'd': /* Deduplication 0=none 1=Storage 2=Local */