]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: properly update capability's client_follow
authorYan, Zheng <zyan@redhat.com>
Wed, 17 Dec 2014 06:09:52 +0000 (14:09 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 5 Feb 2015 14:40:38 +0000 (22:40 +0800)
handle discontinuous snapid(s)

Fixes: #10323
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/Locker.cc

index 8370fa63080a6609dcec25d57630a63855093f42..39dcbb4d38f375007a9cefdf7f0cbf315f90e030 100644 (file)
@@ -2536,7 +2536,7 @@ void Locker::handle_client_caps(MClientCaps *m)
              << " client." << client << " on " << *in << dendl;
 
       // this cap now follows a later snap (i.e. the one initiating this flush, or later)
-      cap->client_follows = MAX(follows, in->first) + 1;
+      cap->client_follows = MAX(snap, (snapid_t)(in->first + 1));
    
       // we can prepare the ack now, since this FLUSHEDSNAP is independent of any
       // other cap ops.  (except possibly duplicate FLUSHSNAP requests, but worst
@@ -2860,7 +2860,7 @@ void Locker::_do_snap_update(CInode *in, snapid_t snap, int dirty, snapid_t foll
   }
 
   if (pi->client_ranges.count(client)) {
-    if (in->last == follows+1) {
+    if (in->last == snap) {
       dout(10) << "  removing client_range entirely" << dendl;
       pi->client_ranges.erase(client);
     } else {