From a5662293a289caf524b5b785edb0022ad2a81a67 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 7 Jun 2011 09:58:29 -0700 Subject: [PATCH] client: fix mds routing for link requests We want to send link requests to the auth for the new name, not the target inode. We also want to drop FILE_SHARED caps on new name's directory. Signed-off-by: Sage Weil --- src/client/Client.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 1207460e7deff..e44857b99c00b 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -6274,11 +6274,11 @@ int Client::_link(Inode *in, Inode *dir, const char *newname, int uid, int gid) req->set_filepath(path); filepath existing(in->ino); req->set_filepath2(existing); - req->inode = in; - req->dentry_drop = CEPH_CAP_FILE_SHARED; - req->dentry_unless = CEPH_CAP_FILE_EXCL; - req->inode = in; + req->inode = dir; + req->inode_drop = CEPH_CAP_FILE_SHARED; + req->inode_unless = CEPH_CAP_FILE_EXCL; + int res = get_or_create(dir, newname, &req->dentry); if (res < 0) return res; -- 2.39.5