]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
make ll_forget more foregiving
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Sun, 2 Sep 2007 20:32:22 +0000 (20:32 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Sun, 2 Sep 2007 20:32:22 +0000 (20:32 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1775 29311d96-e01e-0410-9327-a35deaab8ce9

trunk/ceph/client/Client.cc

index aceaed3e394e8781f6d5bbc39a03c562b13c5da5..7ee7b69b83ab8eecd36d532b27a646e5873e1f80 100644 (file)
@@ -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;
 }