Skip to content
Permalink
Browse files

Squashed commit of the following:

commit 613a5f2
Author: Andreas Rogge <andreas.rogge@bareos.com>
Date:   Wed Apr 10 12:42:31 2019 +0200

    stored: do not write duplicate SOS during MAC run

    Fixes #1030: bscan does not work for migration and copy jobs

    Previously when running a migrate, copy or virtual full backup the
    resulting volume contained not one but two SOS records. The newly
    generated one and the original one.

    This patch now makes sure that only the newly generated SOS record is
    written to the destination volume.
    This patch also makes sure that the fields job_name, client_name,
    fileset_name and fileset_md5 are written in the new SOS.

commit 88d9197
Author: Andreas Rogge <andreas.rogge@bareos.com>
Date:   Wed Apr 10 12:36:41 2019 +0200

    bscan: fix crash on excessive SOS records

    Previously the bscan utility crashed when it read a volume that
    contained excessive SOS records (i.e. more SOS than EOS records) and was
    asked to sync these to the database.
    This patch fixes that crash so that volumes with broken SOS/EOS can now
    be scanned again.
  • Loading branch information...
arogge committed Apr 15, 2019
1 parent c809330 commit ac363923428c79da8acb8c3288595709c4135c1e
Showing with 10 additions and 13 deletions.
  1. +0 −2 src/stored/bscan.c
  2. +10 −11 src/stored/mac.c
@@ -754,8 +754,6 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
if (!db->update_job_end_record(bjcr, &jr)) {
Pmsg1(0, _("Could not update job record. ERR=%s\n"), db->strerror());
}
mjcr->read_dcr = NULL;
free_jcr(mjcr);
}
}
mr.VolFiles = rec->File;
@@ -147,13 +147,16 @@ static bool clone_record_internally(DCR *dcr, DEV_RECORD *rec)

unser_session_label(label, rec);

/*
* set job info from first SOS label
*/
if (jcr->is_JobType(JT_MIGRATE) || jcr->is_JobType(JT_COPY)) {
bstrncpy(jcr->Job, label->Job, sizeof(jcr->Job));
pm_strcpy(jcr->job_name, label->JobName);
pm_strcpy(jcr->client_name, label->ClientName);
pm_strcpy(jcr->fileset_name, label->FileSetName);
pm_strcpy(jcr->fileset_md5, label->FileSetMD5);
}
jcr->setJobType(label->JobType);
jcr->setJobLevel(label->JobLevel);
Dmsg1(200, "joblevel from SOS_LABEL is now %c\n", label->JobLevel);
bstrncpy(jcr->Job, label->Job, sizeof(jcr->Job));

if (label->VerNum >= 11) {
jcr->sched_time = btime_to_unix(label->write_btime);
@@ -177,15 +180,11 @@ static bool clone_record_internally(DCR *dcr, DEV_RECORD *rec)
}
} else {
Dmsg0(200, "Found additional SOS_LABEL, ignoring! \n");
retval = true;
goto bail_out;
}

} else {
/* Other label than SOS -> skip */
retval = true;
goto bail_out;
}
/* Other label than SOS -> skip */
retval = true;
goto bail_out;
}

/*

0 comments on commit ac36392

Please sign in to comment.
You can’t perform that action at this time.