]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "mds: properly setup client_need_snapflush for snap inode" 31284/head
authorYan, Zheng <zyan@redhat.com>
Thu, 31 Oct 2019 10:45:37 +0000 (18:45 +0800)
committerYan, Zheng <zyan@redhat.com>
Fri, 1 Nov 2019 01:36:32 +0000 (09:36 +0800)
This reverts commit 0faa143a459c00b1cf6b562873e446a69467cef1.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit 06b878c5bbb6e35b8428281fc648bc2316192ae7)

 Conflicts:
src/mds/Locker.cc

src/mds/Locker.cc

index a4040d5c8e995dc1b53dee798ee5faf483f2876b..440c35f8727c75287c397dd0561e3c6e9654445c 100644 (file)
@@ -3012,8 +3012,9 @@ void Locker::handle_client_caps(MClientCaps *m)
        dout(10) << " revocation in progress, not making any conclusions about null snapflushes" << dendl;
       }
     }
+    if (cap->need_snapflush() && !(m->flags & MClientCaps::FLAG_PENDING_CAPSNAP))
+      cap->clear_needsnapflush();
 
-    bool need_snapflush = cap->need_snapflush();
     if (m->get_dirty() && in->is_auth()) {
       dout(7) << " flush client." << client << " dirty " << ccap_string(m->get_dirty())
              << " seq " << m->get_seq() << " on " << *in << dendl;
@@ -3021,12 +3022,6 @@ void Locker::handle_client_caps(MClientCaps *m)
                            m->get_caps(), 0, m->get_dirty(), 0, mds->get_osd_epoch_barrier());
       ack->set_client_tid(m->get_client_tid());
       ack->set_oldest_flush_tid(m->get_oldest_flush_tid());
-
-      // client flushes and releases caps at the same time. make sure MDCache::cow_inode()
-      // properly setup CInode::client_need_snapflush
-      if (!need_snapflush && (m->get_dirty() & ~cap->issued()) &&
-         (m->flags & MClientCaps::FLAG_PENDING_CAPSNAP))
-       cap->mark_needsnapflush();
     }
 
     // filter wanted based on what we could ever give out (given auth/replica status)
@@ -3040,15 +3035,10 @@ void Locker::handle_client_caps(MClientCaps *m)
 
       adjust_cap_wanted(cap, new_wanted, m->get_issue_seq());
     }
-
-    bool updated = in->is_auth() &&
-                  _do_cap_update(in, cap, m->get_dirty(), follows, m, ack, &need_flush);
-
-    if (cap->need_snapflush() &&
-       (!need_snapflush || !(m->flags & MClientCaps::FLAG_PENDING_CAPSNAP)))
-      cap->clear_needsnapflush();
-
-    if (updated) {
+      
+    if (in->is_auth() &&
+       _do_cap_update(in, cap, m->get_dirty(), follows, m, ack, &need_flush)) {
+      // updated
       eval(in, CEPH_CAP_LOCKS);
 
       if (!need_flush && (cap->wanted() & ~cap->pending()))