Commit 767ea5c3 authored by Sage Weil's avatar Sage Weil

ceph: do not feed bad device ids to crush

Do not feed bad (large) device ids to CRUSH.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent c2e552e7
...@@ -868,6 +868,11 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid, ...@@ -868,6 +868,11 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid,
ps = le16_to_cpu(pgid.ps); ps = le16_to_cpu(pgid.ps);
preferred = (s16)le16_to_cpu(pgid.preferred); preferred = (s16)le16_to_cpu(pgid.preferred);
/* don't forcefeed bad device ids to crush */
if (preferred >= osdmap->max_osd ||
preferred >= osdmap->crush->max_devices)
preferred = -1;
if (poolid >= osdmap->num_pools) if (poolid >= osdmap->num_pools)
return NULL; return NULL;
pool = &osdmap->pg_pool[poolid]; pool = &osdmap->pg_pool[poolid];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment