]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
FDCache: purge hoid on clear 2799/head
authorSamuel Just <sam.just@inktank.com>
Wed, 22 Oct 2014 19:43:55 +0000 (12:43 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 22 Oct 2014 19:43:55 +0000 (12:43 -0700)
We no longer require that a lock on the FD be held for the duration of an
operation, only while accessing the actual index.  We cannot, therefore, assume
that a racing read during lfn_unlink (backfill or scrub) does not still have a
reference to the fd.  We want to remove the fd from the cache to prevent
subsequent operations from finding it while allowing such a racing read to
complete with its existing fd.

Fixes: #9480
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/os/FDCache.h

index 5b06e34afac5a8e89220f042e4305481c3067a2e..9e77873c3227afd061274603d5186aabf1f99ea8 100644 (file)
@@ -85,11 +85,7 @@ public:
   /// clear cached fd for hoid, subsequent lookups will get an empty FD
   void clear(const ghobject_t &hoid) {
     int registry_id = hoid.hobj.hash % registry_shards;
-    registry[registry_id].clear(hoid);
-    if (registry[registry_id].lookup(hoid)) {
-      registry[registry_id].dump_weak_refs();
-      assert(!registry[registry_id].lookup(hoid));
-    }
+    registry[registry_id].purge(hoid);
   }
 
   /// md_config_obs_t