Skip to content

add new return value to is_valid_tomb()#579

Merged
jaromil merged 3 commits into
dyne:masterfrom
Narrat:optim/valid_tomb
Sep 17, 2025
Merged

add new return value to is_valid_tomb()#579
jaromil merged 3 commits into
dyne:masterfrom
Narrat:optim/valid_tomb

Conversation

@Narrat

@Narrat Narrat commented Aug 18, 2025

Copy link
Copy Markdown
Collaborator

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 isLuks calls. 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.

Narrat added 3 commits August 18, 2025 20:04
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.
@jaromil

jaromil commented Sep 17, 2025

Copy link
Copy Markdown
Member

More readable and looks good to move those checks where you did.

@jaromil jaromil merged commit e6ce62e into dyne:master Sep 17, 2025
2 checks passed
@Narrat Narrat deleted the optim/valid_tomb branch September 21, 2025 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants