-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Description
Describe the bug
We have a scenario where we changed the block size used in the ZMS partition. When upgrading from old FW this result in an expected error when calling zms_mount(). We detect this in our fw and call zms_clear() to just wipe the partition.
However, if you call zms_clear() after zms_mount() has failed zms_clear() will do nothing and return -EACCES due to these lines:
if (!fs->ready) {
LOG_ERR("zms not initialized");
return -EACCES;
}fs->ready will be set to true only if zms_mount() succeeds completely. Hence, zms_clear() can currently not be used for recovering from a corrupt ZMS partition.
The workaround is of course to manually set fs->ready = true before calling zms_clear().
I can make a simple patch just removing the if statement, but I'm guessing there maybe was a specific reason why it is there in the first place so I want to check here first.
Regression
- This is a regression.
Steps to reproduce
No response
Relevant log output
Impact
Functional Limitation – Some features not working as expected, but system usable.
Environment
SHA: we use ff8f0c5, but current main cb2109e has the same lines in zms_clear()
Additional Context
No response