]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: invalid use of RGWFileHandle::FLAG_EXACT_MATCH
authorMatt Benjamin <mbenjamin@redhat.com>
Sun, 19 Feb 2017 22:43:17 +0000 (17:43 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Mon, 20 Feb 2017 01:43:28 +0000 (20:43 -0500)
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>
src/rgw/rgw_file.cc

index e2b963154ff51ede8321d1828933b97cea0f00c4..adbe29e0fa1a8386f7b32b3a1d54eef71c06e928 100644 (file)
@@ -1371,7 +1371,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;