From 6ae88fef66ebd7d04e2ec4a8a0d447188b9221a2 Mon Sep 17 00:00:00 2001 From: Alain Spineux Date: Mon, 28 Nov 2022 10:20:23 +0100 Subject: [PATCH] bscan: initialize the volume type using the device type - bscan was initializing this value to ZERO and this was working as expected because we include ZERO in our SQL query, like in : AND VolType IN (0,%d)", mr->VolType) - I have tested this with File (1) and Dedup (15) devices --- bacula/src/stored/bscan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bacula/src/stored/bscan.c b/bacula/src/stored/bscan.c index ba68c6339..5ee839bad 100644 --- a/bacula/src/stored/bscan.c +++ b/bacula/src/stored/bscan.c @@ -506,6 +506,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec) bstrncpy(mr.VolumeName, dev->VolHdr.VolumeName, sizeof(mr.VolumeName)); mr.PoolId = pr.PoolId; mr.VolEncrypted = !!(dev->VolHdr.blkh_options & BLKHOPT_ENCRYPT_VOL); + mr.VolType = dev->dev_type; num_media++; if (db_get_media_record(bjcr, db, &mr)) { if (verbose) { -- 2.47.3