]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: mds: avoid unnecessary log flush when setattr
authorYan, Zheng <zyan@redhat.com>
Thu, 21 Jul 2016 09:39:54 +0000 (17:39 +0800)
committerYan, Zheng <zyan@redhat.com>
Fri, 22 Jul 2016 02:24:41 +0000 (10:24 +0800)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/Server.cc

index bae791b051631617ec123bdd442ccf61552549b6..9e4df14040433bb60f2f348a61a416dfb4570d8e 100644 (file)
@@ -3839,7 +3839,8 @@ void Server::handle_client_setattr(MDRequestRef& mdr)
                                                                   truncating_smaller, changed_ranges));
 
   // flush immediately if there are readers/writers waiting
-  if (cur->get_caps_wanted() & (CEPH_CAP_FILE_RD|CEPH_CAP_FILE_WR))
+  if (xlocks.count(&cur->filelock) &&
+      (cur->get_caps_wanted() & (CEPH_CAP_FILE_RD|CEPH_CAP_FILE_WR)))
     mds->mdlog->flush();
 }