From 718ced04f13d049cb038dd7d796fa2566a00db4f Mon Sep 17 00:00:00 2001 From: sageweil Date: Sun, 2 Sep 2007 20:32:22 +0000 Subject: [PATCH] make ll_forget more foregiving git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1775 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/client/Client.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/trunk/ceph/client/Client.cc b/trunk/ceph/client/Client.cc index aceaed3e394e8..7ee7b69b83ab8 100644 --- a/trunk/ceph/client/Client.cc +++ b/trunk/ceph/client/Client.cc @@ -3381,8 +3381,14 @@ bool Client::ll_forget(inodeno_t ino, int num) } else { Inode *in = inode_map[ino]; assert(in); - if (_ll_put(in, num) == 0) + if (in->ll_ref < num) { + dout(1) << "WARNING: ll_forget on " << ino << " " << num << ", which only has ll_ref=" << in->ll_ref << dendl; + _ll_put(in, in->ll_ref); last = true; + } else { + if (_ll_put(in, num) == 0) + last = true; + } } return last; } -- 2.39.5