From: Yan, Zheng Date: Wed, 18 Jan 2017 08:23:49 +0000 (+0800) Subject: mds: fix incorrect assertion in Server::_dir_is_nonempty() X-Git-Tag: v11.2.1~200^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F13555%2Fhead;p=ceph.git mds: fix incorrect assertion in Server::_dir_is_nonempty() when filelock is in XLOCKDONE state. client of xlocker can rdlock the filelock. In that case, only client of xlocker can read the lock. Fixes: http://tracker.ceph.com/issues/18578 Signed-off-by: Yan, Zheng (cherry picked from commit fe4ab52b30079a785be053a9fd0197d6990737fe) --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 2f29757b4677..f5e88717ecee 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -6054,7 +6054,7 @@ bool Server::_dir_is_nonempty(MDRequestRef& mdr, CInode *in) { dout(10) << "dir_is_nonempty " << *in << dendl; assert(in->is_auth()); - assert(in->filelock.can_read(-1)); + assert(in->filelock.can_read(mdr->get_client())); frag_info_t dirstat; version_t dirstat_version = in->get_projected_inode()->dirstat.version;