From: Dan van der Ster Date: Thu, 10 Aug 2017 09:33:46 +0000 (+0200) Subject: client: skip lookupname if writing to unlinked file X-Git-Tag: v10.2.10~48^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F17396%2Fhead;p=ceph.git client: skip lookupname if writing to unlinked file 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 (cherry picked from commit 1d617eee2e8c32f7300cb2cb8dd37b3714a4699f) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 611181b49888..9c498421f12c 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -12213,6 +12213,12 @@ Inode *Client::get_quota_root(Inode *in) 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);