Skip to content

Commit

Permalink
rgw_file: invalid use of RGWFileHandle::FLAG_EXACT_MATCH
Browse files Browse the repository at this point in the history
The change which introduced this flag also caused it to be
given as the flags argument to RGWLibFS::stat_leaf() when called
from rgw_lookup().

This was incorrect:  in particular, when a directory is known only
as a common prefix of other objects, the AWS namespace mapping
convention requires lookup("foo") to match a non-materialized
instance of "foo/" (case 2 in RGWLibFS::stat_leaf's stat loop).

Fixes: http://tracker.ceph.com/issues/18992

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit e31e9eb)
  • Loading branch information
mattbenjamin authored and smithfarm committed Jul 4, 2017
1 parent 8452c0c commit 70ebe96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rgw/rgw_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ int rgw_lookup(struct rgw_fs *rgw_fs,
return -ENOENT;
}
} else {
fhr = fs->stat_leaf(parent, path, RGWFileHandle::FLAG_EXACT_MATCH);
fhr = fs->stat_leaf(parent, path, RGWFileHandle::FLAG_NONE);
if (! get<0>(fhr)) {
if (! (flags & RGW_LOOKUP_FLAG_CREATE))
return -ENOENT;
Expand Down

0 comments on commit 70ebe96

Please sign in to comment.