From 4128814da79a18454a3671d01386bf87e9aa0cc8 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 22 Oct 2014 12:43:55 -0700 Subject: [PATCH] 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 --- src/os/FDCache.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 -- 2.47.3