These refs won't be returned by nfs-ganesha, and are sufficiently
magical that other consumers should be persuaded to understand
their specialness.
Fixes: http://tracker.ceph.com/issues/19060
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit
dea8d1ee373399a21851690a9753388b659b8ede)
LookupFHResult fhr;
if (parent->is_root()) {
- /* special: lookup on root itself */
- if (strcmp(path, "/") == 0) {
- rgw_fh = fs->ref(parent);
+ /* special: parent lookup--note lack of ref()! */
+ if (unlikely((strcmp(path, "..") == 0) ||
+ (strcmp(path, "/") == 0))) {
+ rgw_fh = parent;
} else {
fhr = fs->stat_bucket(parent, path, RGWFileHandle::FLAG_NONE);
rgw_fh = get<0>(fhr);