]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't mark cap NEEDSNAPFLUSH if client has no pending capsnap 28551/head
authorYan, Zheng <zyan@redhat.com>
Fri, 14 Jun 2019 09:32:42 +0000 (17:32 +0800)
committerYan, Zheng <zyan@redhat.com>
Fri, 14 Jun 2019 09:40:42 +0000 (17:40 +0800)
This avoid getting wrlocks and setup client_snap_caps on snap inode.
Because there is no further snapflush that triggers releasing these
wrlocks.

Fixes: https://tracker.ceph.com/issues/40361
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/Locker.cc

index 0294e575245e19f9b1c4976d33156a36d374a881..08494469d5a24bf9321a92c91b4dffcf7a4af281 100644 (file)
@@ -2981,7 +2981,8 @@ void Locker::handle_client_caps(const cref_t<MClientCaps> &m)
 
       // client flushes and releases caps at the same time. make sure MDCache::cow_inode()
       // properly setup CInode::client_need_snapflush
-      if ((dirty & ~cap->issued()) && !need_snapflush)
+      if (!need_snapflush && (dirty & ~cap->issued()) &&
+         (m->flags & MClientCaps::FLAG_PENDING_CAPSNAP))
        cap->mark_needsnapflush();
     }