]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw_file: interned RGWFileHandle objects need parent refs 13084/head
authorMatt Benjamin <mbenjamin@redhat.com>
Sat, 31 Dec 2016 04:30:16 +0000 (23:30 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Tue, 24 Jan 2017 17:57:11 +0000 (12:57 -0500)
commit0e5299f3f43e633a5d8a9360893b4b11f6217d81
tree5fac74f3ac7a223dee96e8c15fad40d94b6832ce
parent748f0a6fb99dae8c3e1f42ce9f36f2f60573d710
rgw_file:  interned RGWFileHandle objects need parent refs

RGW NFS fhcache/RGWFileHandle operators assume existence of the
full chain of parents from any object to the its fs_root--this is
a consequence of the weakly-connected namespace design goal, and
not a defect.

This change ensures the invariant by taking a parent ref when
objects are interned (when a parent ref is guaranteed).  Parent
refs are returned when objects are destroyed--essentially by the
invariant, such a ref must exist.

The extra ref is omitted when parent->is_root(), as that node is
not in the LRU cache.

Fixes: http://tracker.ceph.com/issues/18650
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_file.cc
src/rgw/rgw_file.h