mirror of
https://github.com/ceph/ceph
synced 2025-02-19 08:57:27 +00:00
os/FuseStore: do not call exists() on an out-of-bounds oid
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
ca4f077edd
commit
b2a1c8614f
@ -210,6 +210,26 @@ static int os_getattr(const char *path, struct stat *stbuf)
|
||||
stbuf->st_gid = 0;
|
||||
stbuf->st_mode = S_IFREG | 0700;
|
||||
|
||||
switch (t) {
|
||||
case FN_OBJECT_OMAP:
|
||||
case FN_OBJECT_ATTR:
|
||||
case FN_OBJECT:
|
||||
case FN_OBJECT_DATA:
|
||||
case FN_OBJECT_OMAP_HEADER:
|
||||
case FN_OBJECT_OMAP_VAL:
|
||||
{
|
||||
spg_t pgid;
|
||||
if (cid.is_pg(&pgid)) {
|
||||
int bits = fs->store->collection_bits(cid);
|
||||
if (bits >= 0 && !oid.match(bits, pgid.ps())) {
|
||||
// sorry, not part of this PG
|
||||
return -ENOENT;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
switch (t) {
|
||||
case FN_OBJECT_OMAP:
|
||||
case FN_OBJECT_ATTR:
|
||||
|
Loading…
Reference in New Issue
Block a user