luks2: A few APIs fail if meta data locking feature is on(its on by default)
example code sequence that works with LUKS1 volume but fail with LUKS2 volume:
crypt_init()
crypt_load()
crypt_keyslot_max()
To make the above code work,metadata locking must be disabled with below sequence
crypt_init()
crypt_metadata_locking()
crypt_load()
crypt_keyslot_max()
The same pattern was observed when creating a LUKS2 volume,when adding a key to a LUKS2 volume,when deleting a key from LUKS2 volume.
All tests where conducted in an image file using libcryptsetup library.
It was also observed that meta data locking must be disabled before calling crypt_init_by_name() if a context is to be obtained with this API.
tested with "wip-luks2" commit number: a3b8d8cbe2be15518d15b9257ac726e09ad7c151