]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix incorrect assertion in Server::_dir_is_nonempty() 12973/head
authorYan, Zheng <zyan@redhat.com>
Wed, 18 Jan 2017 08:23:49 +0000 (16:23 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 19 Jan 2017 14:38:57 +0000 (22:38 +0800)
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 <zyan@redhat.com>
src/mds/Server.cc

index 5bdf3a41b085dcbf6cd5c8e3893289419a5fbac9..126dbb2d854ba2a78d7fd524ed517e7f86b93d7b 100644 (file)
@@ -6098,7 +6098,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;