]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Revert "properly setup client_need_snapflush for snap inode" 31079/head
authorYan, Zheng <zyan@redhat.com>
Mon, 26 Aug 2019 12:30:26 +0000 (20:30 +0800)
committerNathan Cutler <ncutler@suse.com>
Wed, 23 Oct 2019 12:33:30 +0000 (14:33 +0200)
This reverts commit 9fb61cd65895dbdb92cb46d24be8bf79ce57409d. That
commit handle a case that cap message flushes dirty caps and releases
the same same caps. MDCache::cow_inode() loses track of the released
caps and does not create snap inode.

Previous commit make mds track dirty snap caps as whole. Above case
become "cap message releases all write caps". If client can release
all wirte caps, it should have already sent all snap flush message.

 Conflicts:
src/mds/Locker.cc

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

src/mds/Locker.cc

index fcd7deb93cdcd0d1d40c530d2b568290c0a6c58e..c9713bcfa75dd4fbf07c9b61781d1b4013cc4205 100644 (file)
@@ -2949,8 +2949,9 @@ void Locker::handle_client_caps(const MClientCaps::const_ref &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 (dirty && in->is_auth()) {
       dout(7) << " flush client." << client << " dirty " << ccap_string(dirty)
              << " seq " << m->get_seq() << " on " << *in << dendl;
@@ -2958,12 +2959,6 @@ void Locker::handle_client_caps(const MClientCaps::const_ref &m)
           m->get_caps(), 0, 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 && (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)
@@ -2978,14 +2973,9 @@ void Locker::handle_client_caps(const MClientCaps::const_ref &m)
       adjust_cap_wanted(cap, new_wanted, m->get_issue_seq());
     }
 
-    bool updated = in->is_auth() &&
-                  _do_cap_update(in, cap, 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, dirty, follows, m, ack, &need_flush)) {
+      // updated
       eval(in, CEPH_CAP_LOCKS);
 
       if (!need_flush && (cap->wanted() & ~cap->pending()))