projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c2e552e
)
ceph: do not feed bad device ids to crush
author
Sage Weil
<sage@newdream.net>
Wed, 9 Dec 2009 20:34:01 +0000
(12:34 -0800)
committer
Sage Weil
<sage@newdream.net>
Wed, 9 Dec 2009 23:57:16 +0000
(15:57 -0800)
Do not feed bad (large) device ids to CRUSH.
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/osdmap.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/ceph/osdmap.c
b/fs/ceph/osdmap.c
index 8c994c714781ea8dd8521b37933cb57fe21fd50a..be5318aa77141381a15410131a11fc7d577915a0 100644
(file)
--- 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,
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];