Project

General

Profile

Actions

Bug #14229

closed

MemStore: need a guard when read the entire object

Added by xie xingguo over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

int MemStore::read(
    coll_t cid,
    const ghobject_t& oid,
    uint64_t offset,
    size_t len,
    bufferlist& bl,
    uint32_t op_flags,
    bool allow_eio)
{
  dout(10) << __func__ << " " << cid << " " << oid << " " 
       << offset << "~" << len << dendl;
  CollectionRef c = get_collection(cid);
  if (!c)
    return -ENOENT;

  ObjectRef o = c->get_object(oid);
  if (!o)
    return -ENOENT;
  if (offset >= o->get_size())
    return 0;
  size_t l = len;
  if (l == 0)  // note: len == 0 means read the entire object
    // also need a guard here
    l = o->get_size();
Actions #1

Updated by Kefu Chai over 8 years ago

  • Description updated (diff)
Actions

Also available in: Atom PDF