From ef264d9b385759dc229a49d9c65f78039b2f8eaf Mon Sep 17 00:00:00 2001 From: Luis Henriques Date: Thu, 16 May 2019 11:50:56 +0100 Subject: [PATCH] common/secret.c: fix key parsing when doing a remount When doing a CephFS remount (-o remount) the secret is parsed from procfs and we get '' 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 (cherry picked from commit f44516bcde8d48ef5dca4f92017d1e241eb8e26e) --- src/common/secret.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/secret.c b/src/common/secret.c index b6f26ec3ece5c..8f92fb0a7f01b 100644 --- a/src/common/secret.c +++ b/src/common/secret.c @@ -101,8 +101,8 @@ int get_secret_option(const char *secret, const char *key_name, option[olen] = '\0'; - - if (secret) { + /* when parsing kernel options (-o remount) we get '' as the secret */ + if (secret && (strcmp(secret, "") != 0)) { ret = set_kernel_secret(secret, key_name); if (ret < 0) { if (ret == -ENODEV || ret == -ENOSYS) { -- 2.39.5