From 2e0f35c57791818eac49974c85dd4dc8ed592c06 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Sat, 10 Mar 2018 15:25:56 -0500 Subject: [PATCH] rgw_file: conditionally unlink handles when direct deleted The deadlock fix in 3cf0880 deals correctly deals with the recycle-path locking, but incorrectly removed handle table cleanup in the !recycle-path case. The conditional handle removal is predicated on not being in the recycle path, so this cannot deadlock. Fixes: http://tracker.ceph.com/issues/23299 Signed-off-by: Matt Benjamin --- src/rgw/rgw_file.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index cb62f7ce54f88..73e1479732899 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -951,6 +951,11 @@ namespace rgw { } RGWFileHandle::~RGWFileHandle() { + /* !recycle case, handle may STILL be in handle table, BUT + * the partition lock is not held in this path */ + if (fh_hook.is_linked()) { + fs->fh_cache.remove(fh.fh_hk.object, this, FHCache::FLAG_LOCK); + } /* cond-unref parent */ if (parent && (! parent->is_mount())) { /* safe because if parent->unref causes its deletion, -- 2.39.5