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>
<< " 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