|
@@ -5289,21 +5289,22 @@ SLAB_ATTR(shrink);
|
|
|
#ifdef CONFIG_NUMA
|
|
|
static ssize_t remote_node_defrag_ratio_show(struct kmem_cache *s, char *buf)
|
|
|
{
|
|
|
- return sprintf(buf, "%d\n", s->remote_node_defrag_ratio / 10);
|
|
|
+ return sprintf(buf, "%u\n", s->remote_node_defrag_ratio / 10);
|
|
|
}
|
|
|
|
|
|
static ssize_t remote_node_defrag_ratio_store(struct kmem_cache *s,
|
|
|
const char *buf, size_t length)
|
|
|
{
|
|
|
- unsigned long ratio;
|
|
|
+ unsigned int ratio;
|
|
|
int err;
|
|
|
|
|
|
- err = kstrtoul(buf, 10, &ratio);
|
|
|
+ err = kstrtouint(buf, 10, &ratio);
|
|
|
if (err)
|
|
|
return err;
|
|
|
+ if (ratio > 100)
|
|
|
+ return -ERANGE;
|
|
|
|
|
|
- if (ratio <= 100)
|
|
|
- s->remote_node_defrag_ratio = ratio * 10;
|
|
|
+ s->remote_node_defrag_ratio = ratio * 10;
|
|
|
|
|
|
return length;
|
|
|
}
|