From: Yan, Zheng Date: Thu, 16 Apr 2015 08:34:25 +0000 (+0800) Subject: mds: properly update capability's client_follow X-Git-Tag: v9.0.1~94^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d08d834d53ea1a0470177897e21b2c11ba9d796e;p=ceph.git mds: properly update capability's client_follow 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 --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index e5fe813c8884..f49f8eead9dc 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -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