]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
CrushWrapper:get_bucket: ret ENOENT for no bucket
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 10 Nov 2010 07:48:01 +0000 (23:48 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 10 Nov 2010 07:58:13 +0000 (23:58 -0800)
commitd1f15daf58a65f081b7de9c4ff964717c266d858
treeb9c27d00935657b24aa3de2dd7eb82d694e12a85
parent11cfcfe87503e50c892178d9c5c5b55da3aac740
CrushWrapper:get_bucket: ret ENOENT for no bucket

All the callers of CrushWrapper::get_bucket() check for error codes, but
not for NULL returns. So if there is no bucket (i.e., a NULL pointer) at
crush->bucket[i], just return the error code ENOENT. This is consistent
with how we handle other out-of-bounds requests.

Also, don't allow the caller to get us to try to access negative indices
in crush->bucket.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
src/crush/CrushWrapper.h