From: Sage Weil Date: Fri, 9 Nov 2012 14:06:42 +0000 (-0800) Subject: client: assert cap refs don't go negative X-Git-Tag: v0.54~7^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=128fed8e17e6449400b2e7deaa2cf6018b079ea2;p=ceph.git client: assert cap refs don't go negative This is the root cause of #3470. Signed-off-by: Sage Weil --- diff --git a/src/client/Inode.cc b/src/client/Inode.cc index fc2b03f00d08..c436fe4be14b 100644 --- a/src/client/Inode.cc +++ b/src/client/Inode.cc @@ -115,6 +115,10 @@ bool Inode::put_cap_ref(int cap) while (cap) { if (cap & 1) { int c = 1 << n; + if (cap_refs[c] <= 0) { + lderr(cct) << "put_cap_ref " << ccap_string(c) << " went negative on " << *this << dendl; + assert(cap_refs[c] > 0); + } if (--cap_refs[c] == 0) last = true; //cout << "inode " << *this << " put " << cap_string(c) << " " << (cap_refs[c]+1) << " -> " << cap_refs[c] << std::endl;