From: Jeff Layton Date: Tue, 20 Dec 2016 13:07:23 +0000 (-0500) Subject: client: set metadata["root"] from mount method when it's called with a pathname X-Git-Tag: v10.2.6~164^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f2dfc200dbf93927ca1059ae203c8242b23eeb40;p=ceph.git 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 (cherry picked from commit 9f8810008c82eebe6e354e7e321e33a3dcba8407) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 112bf40b01b3..0c9fd4e31cc4 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -5554,8 +5554,10 @@ int Client::mount(const std::string &mount_root, bool require_mds) } 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);