]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Revert "properly setup client_need_snapflush for snap inode" 29902/head
authorYan, Zheng <zyan@redhat.com>
Mon, 26 Aug 2019 12:30:26 +0000 (20:30 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 17 Sep 2019 03:10:48 +0000 (11:10 +0800)
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>
src/mds/Locker.cc

index 7515b6a76fc184218fbac5dbfd82299d67f7655a..cdc985a2de41e06ec6658249f0cd66fb27191c42 100644 (file)
@@ -2954,8 +2954,9 @@ void Locker::handle_client_caps(const cref_t<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 (dirty && in->is_auth()) {
       dout(7) << " flush client." << client << " dirty " << ccap_string(dirty)
              << " seq " << m->get_seq() << " on " << *in << dendl;
@@ -2963,12 +2964,6 @@ void Locker::handle_client_caps(const cref_t<MClientCaps> &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)
@@ -2983,14 +2978,9 @@ void Locker::handle_client_caps(const cref_t<MClientCaps> &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()))