]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix mds routing for link requests
authorSage Weil <sage.weil@dreamhost.com>
Tue, 7 Jun 2011 16:58:29 +0000 (09:58 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Tue, 7 Jun 2011 16:58:29 +0000 (09:58 -0700)
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 <sage.weil@dreamhost.com>
src/client/Client.cc

index 1207460e7deffeda494fb90b1d363efb7bf87c63..e44857b99c00bd97830f69643e4b2f860ad2a4f6 100644 (file)
@@ -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;