From c0aa515f8d8c57ec5ee09e3b60df3cac60453c40 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Tue, 28 Feb 2017 15:49:06 -0500 Subject: [PATCH] rgw_file: use fh_hook::is_linked() to check residence Previously we assumed that !deleted handles were resident--there is an observed case where a !deleted handle is !linked. Since we currently use safe_link mode, an is_linked() check is available, and exhaustive. Fixes: http://tracker.ceph.com/issues/19111 Signed-off-by: Matt Benjamin --- src/rgw/rgw_file.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index dbe1ad657a2c..296899f07d85 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -813,8 +813,8 @@ namespace rgw { lsubdout(fs->get_context(), rgw, 17) << __func__ << " " << *this << dendl; - /* if !deleted, then object still in fh_cache */ - if (! deleted()) { + /* remove if still in fh_cache */ + if (fh_hook.is_linked()) { fs->fh_cache.remove(fh.fh_hk.object, this, FHCache::FLAG_LOCK); } return true; -- 2.47.3