]> 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 29231/head
authorYan, Zheng <zyan@redhat.com>
Fri, 14 Jun 2019 09:32:42 +0000 (17:32 +0800)
committerNathan Cutler <ncutler@suse.com>
Tue, 23 Jul 2019 15:52:49 +0000 (17:52 +0200)
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>
(cherry picked from commit 9e0775f99258d6a866465b99e2777bf8bcb2bff6)

src/mds/Locker.cc

index 5a0ddd0a45b958c8fa65f83f648369856607f155..4d156c0bddabfb5245eecc69d892dab9f545b65b 100644 (file)
@@ -2910,7 +2910,8 @@ void Locker::handle_client_caps(const MClientCaps::const_ref &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();
     }