From: Matt Benjamin Date: Wed, 1 Mar 2017 01:24:12 +0000 (-0500) Subject: rgw_file: RGWFileHandle dtor must also cond-unlink from FHCache X-Git-Tag: v11.2.1~16^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ac1dd8d323c5d90e20fd88e56031441f704ee95a;p=ceph.git rgw_file: RGWFileHandle dtor must also cond-unlink from FHCache Formerly masked in part by the reclaim() action, direct-delete now substitutes for reclaim() iff its LRU lane is over its high-water mark, and in particular, like reclaim() the destructor is certain to see handles still interned on the FHcache when nfs-ganesha is recycling objects from its own LRU. Fixes: http://tracker.ceph.com/issues/19112 Signed-off-by: Matt Benjamin (cherry picked from commit d51a3b1224ba62bb53c6c2c7751fcf7853c35a4b) --- diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index 8df15a10413..624bd16b7f1 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -815,6 +815,11 @@ namespace rgw { } RGWFileHandle::~RGWFileHandle() { + /* in the non-delete case, handle may still be in handle table */ + if (fh_hook.is_linked()) { + fs->fh_cache.remove(fh.fh_hk.object, this, FHCache::FLAG_LOCK); + } + /* cond-unref parent */ if (parent && (! parent->is_root())) { /* safe because if parent->unref causes its deletion, * there are a) by refcnt, no other objects/paths pointing