mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-12 05:24:12 +08:00
ceph: do not feed bad device ids to crush
Do not feed bad (large) device ids to CRUSH. Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
c2e552e76e
commit
767ea5c33a
@ -868,6 +868,11 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid,
|
||||
ps = le16_to_cpu(pgid.ps);
|
||||
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)
|
||||
return NULL;
|
||||
pool = &osdmap->pg_pool[poolid];
|
||||
|
Loading…
Reference in New Issue
Block a user