-
Notifications
You must be signed in to change notification settings - Fork 85
Zero metadata superblock on detach #863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use OCF_PL_NEXT_RET() here, so you can drop the else block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted this part according to Michal's comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and done it again with OCF_PL_NEXT_RET ;)
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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
Zero superblock instead of setting the shutdown status.
Metadata from a detached cache device is not meant to be loaded.