From f192e2dceac7dbb14785f6896bbff34cb9fdf8d8 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Wed, 17 Dec 2014 14:09:52 +0800 Subject: [PATCH] mds: properly update capability's client_follow handle discontinuous snapid(s) Fixes: #10323 Signed-off-by: Yan, Zheng --- src/mds/Locker.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 8370fa63080a..39dcbb4d38f3 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -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 { -- 2.47.3