From d08d834d53ea1a0470177897e21b2c11ba9d796e Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Thu, 16 Apr 2015 16:34:25 +0800 Subject: [PATCH] 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 --- src/mds/Locker.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index e5fe813c888..f49f8eead9d 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 -- 2.47.3