From: Matt Benjamin Date: Wed, 22 Feb 2017 15:24:29 +0000 (-0500) Subject: rgw_file: avoid stranding invalid-name bucket handles in fhcache X-Git-Tag: v10.2.7~13^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F13848%2Fhead;p=ceph.git rgw_file: avoid stranding invalid-name bucket handles in fhcache To avoid a string copy in the common mkdir path, handles for proposed buckets currently are staged in the handle table, before being rejected. They need to be destaged, not just marked deleted (because deleted objects are now assumed not to be linked, as of beaeff059375b44188160dbde8a81dd4f4f8c6eb). This triggered an unhandled Boost assert when deleting staged handles, as current safe_link mode requires first removing from the FHCache. Fixes: http://tracker.ceph.com/issues/19036 Signed-off-by: Matt Benjamin (cherry picked from commit 6cde812c92e5bba9f85fbf8486ebe69b55952370) --- diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index b87c388cb665..166e631c6daa 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -434,6 +434,8 @@ namespace rgw { rc = valid_s3_bucket_name(bname, false /* relaxed */); if (rc != 0) { rgw_fh->flags |= RGWFileHandle::FLAG_DELETED; + fh_cache.remove(rgw_fh->fh.fh_hk.object, rgw_fh, + RGWFileHandle::FHCache::FLAG_LOCK); rgw_fh->mtx.unlock(); unref(rgw_fh); get<0>(mkr) = nullptr;