-
Notifications
You must be signed in to change notification settings - Fork 8.4k
subsys: settings: Invalidate entry with the same key in FCB #11574
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
subsys: settings: Invalidate entry with the same key in FCB #11574
Conversation
Fix typos in `settings_test_fcb_init.c`. Signed-off-by: Olivier Martin <[email protected]>
|
Found the following issues, please fix and resubmit: Checkpatch issues |
Fix a typo in a comment. Signed-off-by: Olivier Martin <[email protected]>
Without this commit, entries with the same key name are present in FCB setting partition as many time as they have been written. All these duplicated keys are loaded at the initialisation of the settings susbystem. The consumer of these settings will be notified for each of these key. It could lead to issues in the caller logic. Signed-off-by: Olivier Martin <[email protected]>
9ab6d6c to
a56b6f5
Compare
This is the reason for implementing keep h_commit handler. When loading of settings is done this handler is called for informing the application that most recently configuration was loaded. I reviewed the algorithm. As now I see it is using read-modify-write for making any name-value pair invalid. So if you want to introduce something like this you should align size of the new field you introduced to the smallest write block for the flash device (this can be fetched form the flash driver API). I also recommend to put changes onto #9521 because it changes a lot entire implementation of the settings subsystem. Feature you introduced should has appropriate kconfig key, at last to inform application at compile time that such feature is enabled (probably shouldn't be enabled for FS). I can stand something like |
nvlsianpu
left a 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.
see my comment #11574 (comment)
|
Is this one still valid? Should it be rebased or just closed without merging? |
|
As wrote before:
So rebase is not enough - this is technical issue. |
|
@Olivier-ProGlove Do you still want to work on this PR? I believe the objective behind this PR was fulfilled by #19541. |
|
no response, closing |
Without this PR, entries with the same key name are present in FCB setting partition as many time as they have been written.
All these duplicated keys are loaded at the initialisation of the settings subsystem. The consumer of these settings will be notified for each of these key.
It could lead to issues in the caller logic.
See my comment to see how it affects Zephyr bluetooth stack: #11409 (comment)
With this change, support for deleting settings should be easier to implement properly. Today, to delete a key, users use
settings_save_one("mykey", NULL). Rather than deleting the key it creates a new key with the NULL value.Signed-off-by: Olivier Martin [email protected]