]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: set metadata["root"] from mount method when it's called with a pathname
authorJeff Layton <jlayton@redhat.com>
Tue, 20 Dec 2016 13:07:23 +0000 (08:07 -0500)
committerJeff Layton <jlayton@redhat.com>
Tue, 20 Dec 2016 13:07:23 +0000 (08:07 -0500)
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 <jlayton@redhat.com>
(cherry picked from commit 9f8810008c82eebe6e354e7e321e33a3dcba8407)

src/client/Client.cc

index 112bf40b01b358d2cd48be9f7e09ff0d740a43eb..0c9fd4e31cc464958c50190b905f63c450a27c0e 100644 (file)
@@ -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);