Zero metadata superblock on detach#863
Merged
robertbaldyga merged 2 commits intoOpen-CAS:masterfrom Feb 6, 2025
Merged
Conversation
robertbaldyga
requested changes
Feb 4, 2025
src/mngt/ocf_mngt_cache.c
Outdated
| ocf_metadata_set_shutdown_status(cache, ocf_metadata_detached, | ||
| _ocf_mngt_cache_unplug_complete, context); | ||
| /* Skip metadata update - will be zeroed later in detach pipeline */ | ||
| ocf_pipeline_next(ctx->pipeline); |
Member
There was a problem hiding this comment.
You can use OCF_PL_NEXT_RET() here, so you can drop the else block.
Contributor
Author
There was a problem hiding this comment.
I've reverted this part according to Michal's comment
Contributor
Author
There was a problem hiding this comment.
...and done it again with OCF_PL_NEXT_RET ;)
mmichal10
reviewed
Feb 4, 2025
src/mngt/ocf_mngt_cache.c
Outdated
| if (error) { | ||
| ocf_cache_log(cache, log_err, | ||
| "ERROR: Failed to clear superblock\n"); | ||
| OCF_PL_FINISH_RET(context->pipeline, -OCF_ERR_WRITE_CACHE); |
Contributor
There was a problem hiding this comment.
Even if zeroing superblock has failed, the detach pipeline shouldn't be interrupted. At this point the metadata has already been deinitialized so zeroing superblock is nice to have but it's not necessary.
We could inform the user what has happened, warn about the remnants of metadata and suggest they remove it on their own, but the detach pipeline should proceed
b1ac551 to
6a81bde
Compare
Metadata from a detached cache device is not meant to be loaded. Signed-off-by: Daniel Madej <daniel.madej@huawei.com>
Signed-off-by: Daniel Madej <daniel.madej@huawei.com>
6a81bde to
3263503
Compare
mmichal10
approved these changes
Feb 6, 2025
robertbaldyga
approved these changes
Feb 6, 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.
Zero superblock instead of setting the shutdown status.
Metadata from a detached cache device is not meant to be loaded.