Feature #23514
open[api] image-meta needs to support compare-and-write operation
0%
Description
iSCSI would like to re-use image-meta to store port state and persistent group reservations. In the case of PGRs, it needs to be able to protect against racing reservations in a generic fashion. Expand the "metadata_set" APIs to pass a expected value along with the necessary background changes.
Updated by Mahati Chamarthy over 5 years ago
Jason Dillaman wrote:
iSCSI would like to re-use image-meta to store port state and persistent group reservations. In the case of PGRs, it needs to be able to protect against racing reservations in a generic fashion. Expand the "metadata_set" APIs to pass a expected value along with the necessary background changes.
I see there's metadata_set and metadata_get APIs. Should the change compare the expected value and abandon the write in case of a mismatch? Also could you expand on the necessary background changes? It looks like only checking for a mismatch in the related API would do?