When doing a CephFS remount (-o remount) the secret is parsed from procfs
and we get '<hidden>' as a result and the mount will fail with:
secret is not valid base64: Invalid argument.
adding ceph secret key to kernel failed: Invalid argument.
As the kernel already have the key, we simply need to use it.
Fixes: https://tracker.ceph.com/issues/39951
Signed-off-by: Luis Henriques <lhenriques@suse.com>
(cherry picked from commit
f44516bcde8d48ef5dca4f92017d1e241eb8e26e)
option[olen] = '\0';
-
- if (secret) {
+ /* when parsing kernel options (-o remount) we get '<hidden>' as the secret */
+ if (secret && (strcmp(secret, "<hidden>") != 0)) {
ret = set_kernel_secret(secret, key_name);
if (ret < 0) {
if (ret == -ENODEV || ret == -ENOSYS) {