Skip to content
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

Add 'wi' (Write-Invalidate) as valid cache mode #1148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion utils/opencas.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def check_cache_device_empty(self):
)

def check_cache_mode_valid(self, cache_mode):
if cache_mode not in ['wt', 'pt', 'wa', 'wb', 'wo']:
if cache_mode not in ['wt', 'pt', 'wa', 'wb', 'wo', 'wi']:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand when experimental features are disabled (which is default), WI should not be recognized as a valid cache mode. This option should be accepted only conditionally. The problem is that we currently do not have any good way to recognize whether OpenCAS was compiled with experimental features enabled, so this is another thing to be implemented in order to make casctl work with Write-Invalidate.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't, at some point, some C function fails if WI was not enabled during compile time? Making this patch "safe" even when WI is disabled? For example:

inline int validate_str_cache_mode(const char *s)

raise ValueError(f'Invalid cache mode {cache_mode}')

def check_cleaning_policy_valid(self, cleaning_policy):
Expand Down