]> 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>
Thu, 16 Apr 2015 08:34:25 +0000 (16:34 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 21 Apr 2015 05:56:17 +0000 (13:56 +0800)
If snap inode exists, capability's client_follow has already been
updated by MDCache::cow_inode(). So we only update client_follow
when the inode was not COWed.

Besides, we need to check return of SnapRealm::get_snap_following().
It can return CEPH_NOSNAP, which is clearly invalid for client_follows.

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

index e5fe813c888418b6fcafdaa21ceb61e004efe1e9..f49f8eead9dcb65dabb459bdebfc0c51eb95808e 100644 (file)
@@ -2525,7 +2525,8 @@ 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(snap, (snapid_t)(in->first + 1));
+      if (in == head_in)
+       cap->client_follows = snap < CEPH_NOSNAP ? snap : realm->get_newest_seq();
    
       // we can prepare the ack now, since this FLUSHEDSNAP is independent of any
       // other cap ops.  (except possibly duplicate FLUSHSNAP requests, but worst