storage daemon: fix crash on volume swap#1356
Merged
pstorz merged 6 commits intobareos:masterfrom Jan 25, 2023
Merged
Conversation
d8776b6 to
1c71841
Compare
1c71841 to
c1de9e1
Compare
pstorz
requested changes
Jan 18, 2023
Member
pstorz
left a comment
There was a problem hiding this comment.
Good work! Impressive, how simple now it is to add a new backend device.
13 tasks
aba1ad7 to
4d01d4e
Compare
Allow each backend to decide if it is a tape or not. Previously only a backend named "tape" would be considered a tape. With this change we can now add new backends that are also treated like a tape.
Duplicate the file backend and pretend it is a tape. This is meant for testing purposes only and will allow developers to run autochanger-related tests without the need for an autochanger or a full emulator (like mhvtl).
Add test system:file-autochanger:swapdev to track the broken volume swapping behaviour introduced in Bareos 22.0.0. This also adds a virtual file-based autochanger that can be used for other kinds of tests.
Fix a problem introduced in Bareos 22 with commit 6c265ec replace volatile device pointers with actual variable Due to an oversight in a refactoring, a swap would no longer move the volume to another device, but switch over to use the device that had the desired volume loaded. As that device was not reserved, but was unreserved during acquire, the storage daemon would eventually crash in this case.
Instead of setting the POSITION_INDEPENDENT_CODE flag on individual targets, we simply enable it for everything in core/ Also, by utilizing PIE (Position Independent Executable) support in CMake we make sure all our executables are build with PIE enabled if the toolchain supports it.
4d01d4e to
5243294
Compare
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.
Fix a problem introduced in Bareos 22 with PR #1271 where the SD would crash on a volume swap.
This PR also introduces a testing backend to make it easier to test autochangers. However, a change in the Device interface is required for this (so we shouldn't backport that).
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)
General
Source code quality
bareos-check-sources --since-mergedoes not report any problemsTests