Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix zettacache compatibility checks for old releases (openzfs#492)
Earlier this month the following commit was merged: ``` commit 75c74ba Author: Serapheim Dimitropoulos <[email protected]> Date: Mon Jun 13 14:00:24 2022 -0700 DLPX-81000 Generate Disk GUID for ZettaCache Devices (openzfs#434) Side-Change: Also record sector_size on-disk ``` In that commit, I renamed the `SuperblockPhys::guid` field to `cache_guid` and even though upgrades to the newer on-disk format happen without blowing up the cache's contents, I missed trying to open the new on-disk format with older bits. On that latter scenario we would ideally want to do a feature check with the old bits and proceed to take further actions depending on the feature flags introduced in the new on-disk format. Unfortunately this doesn't happen and instead we blow up because the old bits cannot find the `guid` field in the superblock because it has been renamed. This commit changes the name of that field back to its old version while keeping the name of the in-memory struct the same. This way we still keep the more readable name in the code while ensuring on-disk format compatibility. Side-Changes: * Do feature checks in zcachedb's open() path. * Fix `--clear-incompatible-cache` that somehow over time stopped working
- Loading branch information