From: Zhi Zhang Date: Thu, 14 Jan 2016 03:04:42 +0000 (+0800) Subject: ceph-fuse: double decreased the count to trim caps X-Git-Tag: v0.94.8~16^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=049bc8a498d4ab516c2daded8ac44699aa72c982;p=ceph.git ceph-fuse: double decreased the count to trim caps Signed-off-by: Zhi Zhang zhangz.david@outlook.com (cherry picked from commit d8a3f6d839649243b12cd6f73e6cb8aec1f955c1) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 78599fd5099..717c4d2b420 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -3458,11 +3458,13 @@ void Client::_invalidate_kernel_dcache() void Client::trim_caps(MetaSession *s, int max) { mds_rank_t mds = s->mds_num; - ldout(cct, 10) << "trim_caps mds." << mds << " max " << max << dendl; + int caps_size = s->caps.size(); + ldout(cct, 10) << "trim_caps mds." << mds << " max " << max + << " caps " << caps_size << dendl; int trimmed = 0; xlist::iterator p = s->caps.begin(); - while ((s->caps.size() - trimmed) > max && !p.end()) { + while ((caps_size - trimmed) > max && !p.end()) { Cap *cap = *p; s->s_cap_iterator = cap; Inode *in = cap->inode;