Merged
Conversation
5c5db16 to
fe7339f
Compare
sebsura
approved these changes
Dec 19, 2024
Comment on lines
+548
to
+549
| for (int week = code; week <= 53; week += code2) { | ||
| SetBit(week, res_run.date_time_bitfield.woy); |
Contributor
There was a problem hiding this comment.
This does basically the same as the previous version except it sets week 53 if code=0 (and code2 is e.g. 1).
But i would consider this a bug in the old code, so this should be ok!
Contributor
There was a problem hiding this comment.
One thing i noticed: Should we also update the "module scheduler" for days as well ? It basically uses the same logic/code.
| p = dev_name + strlen(dev_name); | ||
|
|
||
| while (p >= dev_name && !IsPathSeparator(*p)) p--; | ||
| while (p > dev_name && !IsPathSeparator(*p)) p--; |
Contributor
There was a problem hiding this comment.
Good catch! Issues like this are really hard to spot while looking over the code. I feel like something like this would be even more clearer
std::string_view v{dev_name};
if (auto pos = v.find_last_of("/"); pos != v.npos) {
// use the filename as volume name ...
bstrncpy(VolName, &dev_name[pos + 1], sizeof(VolName));
// ... and then delete it from the device name
dev_name[pos] = 0;
}except that "/" would need to be replaced by whatever IsPathSeparator() checks for -- i.e. "\\/" on windows.
remove alias for g_dcr->block as this is unsafe. The memory will be reallocated during operation which will invalidate the alias-pointer.
move to 1:0 instead of 0:1 when doing multi-tape unfill. As we now have a file-mark right after the label block, btape needs to move to the first block after that file-mark instead of the second block in the first file. This change also adds reading the volume label of the second tape, which was not done before.
fe7339f to
0f912c4
Compare
replace the old implementation for the modulo scheduler with a nicer one. This will also fix an out-of-bounds error that was present in the previous code. Co-Authored-By: Sebastian Sura <sebastian.sura@bareos.com>
0f912c4 to
536f426
Compare
This was referenced Feb 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a break of
btapeintroduced in #1958.When we disabled the PRE_LABEL, we introduced a file-mark right after the label block. As the
btapemutli-tape test blindly repositions the tape to the location where it thinks the data starts, tests started to fail.The PR also fixes two memory-issues in
btapeas well as a possible out-of-bounds access when using the modulo scheduler.Thank you for contributing to the Bareos Project!
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
Make sure you check/merge the PR using
devtools/pr-toolto have some simple automated checks run and a proper changelog record added.General
Source code quality