]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: skip lookupname if writing to unlinked file 16959/head
authorDan van der Ster <daniel.vanderster@cern.ch>
Thu, 10 Aug 2017 09:33:46 +0000 (11:33 +0200)
committerDan van der Ster <daniel.vanderster@cern.ch>
Thu, 10 Aug 2017 09:33:46 +0000 (11:33 +0200)
When a client writes to an unlinked file, get_quota_root tries to
resolve the filename via an MDS lookupname op. The op always results in
-13 permission denied for path-restricted caps or -2 no such file or
directory otherwise. More importantly, the repeated lookupname ops slow
down buffered writes significantly.

Don't do the lookupname for unlinked files; use the root_ancentor's
quota instead.

Fixes: http://tracker.ceph.com/issues/20945
Backport: jewel, luminous
Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
src/client/Client.cc

index e461ab4a59eb2157f20e0db8c7441858d511e84a..b971a2bf5c5fda1c0f09f55401bd953bf52131fe 100644 (file)
@@ -13007,6 +13007,12 @@ Inode *Client::get_quota_root(Inode *in, const UserPerm& perms)
     if (cur == root_ancestor)
       break;
 
+    // deleted inode
+    if (cur->nlink == 0) {
+      cur = root_ancestor;
+      break;
+    }
+
     MetaRequest *req = new MetaRequest(CEPH_MDS_OP_LOOKUPNAME);
     filepath path(cur->ino);
     req->set_filepath(path);