]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix mds selection for unlink
authorSage Weil <sage.weil@dreamhost.com>
Tue, 7 Jun 2011 18:11:07 +0000 (11:11 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Tue, 7 Jun 2011 18:11:07 +0000 (11:11 -0700)
It was broken when a remote link target was on another mds.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/client/Client.cc

index 4cc621398f15a6e8fbae71369124808564582788..ee1ea5595892991000760a64ca8b930f558f6720 100644 (file)
@@ -6110,15 +6110,17 @@ int Client::_unlink(Inode *dir, const char *name, int uid, int gid)
   dir->make_nosnap_relative_path(path);
   path.push_dentry(name);
   req->set_filepath(path);
-  req->inode = dir;
-  req->dentry_drop = CEPH_CAP_FILE_SHARED;
-  req->dentry_unless = CEPH_CAP_FILE_EXCL;
-  req->inode_drop = CEPH_CAP_LINK_SHARED | CEPH_CAP_LINK_EXCL;
 
   int res = get_or_create(dir, name, &req->dentry);
   if (res < 0)
     return res;
-  res = _lookup(dir, name, &req->inode);
+  req->dentry_drop = CEPH_CAP_FILE_SHARED;
+  req->dentry_unless = CEPH_CAP_FILE_EXCL;
+
+  res = _lookup(dir, name, &req->other_inode);
+  req->other_inode_drop = CEPH_CAP_LINK_SHARED | CEPH_CAP_LINK_EXCL;
+
+  req->inode = dir;
 
   res = make_request(req, uid, gid);
   if (res == 0) {