git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
bcache: fix BUG_ON due to integer overflow with GC_SECTORS_USED
[pandora-kernel.git]
/
drivers
/
md
/
bcache
/
btree.c
diff --git
a/drivers/md/bcache/btree.c
b/drivers/md/bcache/btree.c
index
98cc0a8
..
7d42118
100644
(file)
--- a/
drivers/md/bcache/btree.c
+++ b/
drivers/md/bcache/btree.c
@@
-1167,7
+1167,7
@@
uint8_t __bch_btree_mark_key(struct cache_set *c, int level, struct bkey *k)
/* guard against overflow */
SET_GC_SECTORS_USED(g, min_t(unsigned,
GC_SECTORS_USED(g) + KEY_SIZE(k),
-
(1 << 14) - 1
));
+
MAX_GC_SECTORS_USED
));
BUG_ON(!GC_SECTORS_USED(g));
}