Skip to content

Commit

Permalink
client: set metadata["root"] from mount method when it's called with …
Browse files Browse the repository at this point in the history
…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 <jlayton@redhat.com>
  • Loading branch information
jtlayton committed Dec 16, 2016
1 parent 478551e commit 9f88100
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/Client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9f88100

Please sign in to comment.