]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librgw: fix RGWLibFS::stat_leaf ex-ref
authorMatt Benjamin <mbenjamin@redhat.com>
Sat, 19 Dec 2015 17:36:49 +0000 (12:36 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 12 Feb 2016 17:07:00 +0000 (12:07 -0500)
Found verifying refcounts at RGWLibFS::close.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/common/cohort_lru.h
src/rgw/rgw_file.cc
src/rgw/rgw_file.h

index d3afa49fba44b27bc2f84554b9363d0c7240475b..cdabb1e5bef81b779e2ef5ab324d0f368b3f9426 100644 (file)
@@ -66,6 +66,8 @@ namespace cohort {
 
       Object() : lru_flags(FLAG_NONE), lru_refcnt(0), lru_adj(0) {}
 
+      uint32_t get_refcnt() const { return lru_refcnt; }
+
       virtual bool reclaim() = 0;
 
       virtual ~Object() {}
index 8527b98abcc4e7488f93f4cd35e6d567911c61b6..9d7d336fa804c534f499475167d81048f09f6dea 100644 (file)
@@ -73,6 +73,7 @@ LookupFHResult RGWLibFS::stat_leaf(RGWFileHandle* parent,
       if ((rc == 0) &&
          (req.get_ret() == 0)) {
        fhr = lookup_fh(parent, path, RGWFileHandle::FLAG_NONE);
+       goto done;
       }
     }
     break;
@@ -97,6 +98,7 @@ LookupFHResult RGWLibFS::stat_leaf(RGWFileHandle* parent,
       break;
     }
   }
+done:
   return fhr;
 } /* RGWLibFS::stat_leaf */
 
index af34a7f4f138384b06db390ef3543ace7f8e142a..bfd80b07760f30d9f125ea9f0a056395747fa9dd 100644 (file)
@@ -666,6 +666,12 @@ namespace rgw {
        ObjUnref(RGWLibFS* fs) : fs(fs) {}
        void operator()(RGWFileHandle* fh) const {
          fs->fh_lru.unref(fh, cohort::lru::FLAG_NONE);
+
+         lsubdout(fs->get_context(), rgw, 5)
+           << __func__
+           << fh->name
+           << " refs=" << fh->get_refcnt()
+           << dendl;
        }
       };