]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw_file: interned RGWFileHandle objects need parent refs 13583/head
authorMatt Benjamin <mbenjamin@redhat.com>
Sat, 31 Dec 2016 04:30:16 +0000 (23:30 -0500)
committerAlexey Sheplyakov <asheplyakov@mirantis.com>
Wed, 22 Feb 2017 09:09:41 +0000 (13:09 +0400)
commit8941881e8986af0b2871c15d188d94d49e95dc02
treed2a278bfc35d8282dcf6982fc137e96e5aff17bf
parent083e0f4ac06f922c32b806d6d027f738c5057cae
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>
(cherry picked from commit 0e5299f3f43e633a5d8a9360893b4b11f6217d81)
src/rgw/rgw_file.cc
src/rgw/rgw_file.h