]> 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 29230/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:50:47 +0000 (17:50 +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)

Conflicts:
src/mds/Locker.cc
- m->get_dirty()

src/mds/Locker.cc

index ecd06294faacfe9113f1f21e1fbc3f8c393d7ace..94b947975a80b891aa313be9a92388afb5a1e00b 100644 (file)
@@ -2956,7 +2956,8 @@ void Locker::handle_client_caps(MClientCaps *m)
 
       // client flushes and releases caps at the same time. make sure MDCache::cow_inode()
       // properly setup CInode::client_need_snapflush
-      if ((m->get_dirty() & ~cap->issued()) && !need_snapflush)
+      if (!need_snapflush && (m->get_dirty() & ~cap->issued()) &&
+         (m->flags & MClientCaps::FLAG_PENDING_CAPSNAP))
        cap->mark_needsnapflush();
     }