From: Yan, Zheng Date: Mon, 6 Mar 2017 03:08:20 +0000 (+0800) Subject: mds: handle race between stray reintegration and rmdir X-Git-Tag: v12.0.2~112^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=456d428bcf89a7b838124a3b20a5b97fc776ef5e;p=ceph.git mds: handle race between stray reintegration and rmdir It's possible that stray reintegration tries moving stray to a removed directory. Signed-off-by: "Yan, Zheng" --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 86f1d5c85835..9f549af7f1ca 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2637,10 +2637,10 @@ CDentry* Server::rdlock_path_xlock_dentry(MDRequestRef& mdr, int n, respond_to_request(mdr, -EROFS); return 0; } - if (!diri->is_base() && diri->get_projected_parent_dir()->inode->is_stray()) { - respond_to_request(mdr, -ENOENT); - return 0; - } + } + if (!diri->is_base() && diri->get_projected_parent_dir()->inode->is_stray()) { + respond_to_request(mdr, -ENOENT); + return 0; } // make a null dentry?