From: Samuel Just Date: Wed, 22 Oct 2014 19:43:55 +0000 (-0700) Subject: FDCache: purge hoid on clear X-Git-Tag: v0.87~4^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2799%2Fhead;p=ceph.git FDCache: purge hoid on clear 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 --- diff --git a/src/os/FDCache.h b/src/os/FDCache.h index 5b06e34afac5..9e77873c3227 100644 --- a/src/os/FDCache.h +++ b/src/os/FDCache.h @@ -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