diff options
author | Sage Weil <sage@newdream.net> | 2009-12-09 15:34:01 -0500 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2009-12-09 18:57:16 -0500 |
commit | 767ea5c33a360ce88da24e296e802dace5821799 (patch) | |
tree | ce2a9862093aec65cd8bd50764a325e053e4369b /fs | |
parent | c2e552e76e2c6907ca50cd9a4b747a2e2e8c615e (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/osdmap.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ceph/osdmap.c b/fs/ceph/osdmap.c index 8c994c714781..be5318aa7714 100644 --- a/fs/ceph/osdmap.c +++ b/fs/ceph/osdmap.c | |||
@@ -868,6 +868,11 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid, | |||
868 | ps = le16_to_cpu(pgid.ps); | 868 | ps = le16_to_cpu(pgid.ps); |
869 | preferred = (s16)le16_to_cpu(pgid.preferred); | 869 | preferred = (s16)le16_to_cpu(pgid.preferred); |
870 | 870 | ||
871 | /* don't forcefeed bad device ids to crush */ | ||
872 | if (preferred >= osdmap->max_osd || | ||
873 | preferred >= osdmap->crush->max_devices) | ||
874 | preferred = -1; | ||
875 | |||
871 | if (poolid >= osdmap->num_pools) | 876 | if (poolid >= osdmap->num_pools) |
872 | return NULL; | 877 | return NULL; |
873 | pool = &osdmap->pg_pool[poolid]; | 878 | pool = &osdmap->pg_pool[poolid]; |