From 9f8810008c82eebe6e354e7e321e33a3dcba8407 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Fri, 16 Dec 2016 10:19:18 -0500 Subject: [PATCH] client: set metadata["root"] from mount method when it's called with a pathname Currently, we only set the root properly config file or the --client_metadata command line option. If a userland client program tries to call ceph_mount with a pathname, it's not being properly set. Since we already hold the mutex, we can just update it directly. Signed-off-by: Jeff Layton --- src/client/Client.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 5220715dad6..2e0adec83e3 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -5628,8 +5628,10 @@ int Client::mount(const std::string &mount_root, const UserPerm& perms, } filepath fp(CEPH_INO_ROOT); - if (!mount_root.empty()) + if (!mount_root.empty()) { + metadata["root"] = mount_root.c_str(); fp = filepath(mount_root.c_str()); + } while (true) { MetaRequest *req = new MetaRequest(CEPH_MDS_OP_GETATTR); req->set_filepath(fp);