Skip to content

Commit

Permalink
Merge pull request #20834 from linuxbox2/wip-linked
Browse files Browse the repository at this point in the history
rgw_file: conditionally unlink handles when direct deleted

Reviewed-by: Casey Bodley <cbodley@redhat.com>
  • Loading branch information
cbodley committed Apr 12, 2018
2 parents 6ef24ff + 2e0f35c commit 68ff1f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rgw/rgw_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 68ff1f1

Please sign in to comment.