add new return value to is_valid_tomb()#579
Merged
Merged
Conversation
can theoretically be problematic, if the file output changes in whatever way
this allows to reduce the number of calls to "cryptsetup isLuks". This is already part of is_valid_tomb but wasn't really utilized. Instead shortly after a call of is_valid_tomb() an explicit call to "cryptsetup isLuks" was done.
4380013 to
aeb4788
Compare
Member
|
More readable and looks good to move those checks where you did. |
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.
While looking into the tombname issue I noticed a small room for simplifing the logic?
In various places it was explicitly checked if a file is a valid tomb. Which is also part of
is_valid_tomb()but it was only used for a status message.Therefore I added a return value to the function, which indicates if it is a valid tomb or not. And depending where it is called the return value is used to remove the explicit
cryptsetup isLukscalls. The overhead of the function is of no concern, as it always called in those locations.That being said this change warrants a careful look, as it shifts the order around a bit.