diff options
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -5108,12 +5108,25 @@ static ssize_t slab_attr_store(struct kobject *kobj, | |||
5108 | if (s->max_attr_size < len) | 5108 | if (s->max_attr_size < len) |
5109 | s->max_attr_size = len; | 5109 | s->max_attr_size = len; |
5110 | 5110 | ||
5111 | /* | ||
5112 | * This is a best effort propagation, so this function's return | ||
5113 | * value will be determined by the parent cache only. This is | ||
5114 | * basically because not all attributes will have a well | ||
5115 | * defined semantics for rollbacks - most of the actions will | ||
5116 | * have permanent effects. | ||
5117 | * | ||
5118 | * Returning the error value of any of the children that fail | ||
5119 | * is not 100 % defined, in the sense that users seeing the | ||
5120 | * error code won't be able to know anything about the state of | ||
5121 | * the cache. | ||
5122 | * | ||
5123 | * Only returning the error code for the parent cache at least | ||
5124 | * has well defined semantics. The cache being written to | ||
5125 | * directly either failed or succeeded, in which case we loop | ||
5126 | * through the descendants with best-effort propagation. | ||
5127 | */ | ||
5111 | for_each_memcg_cache_index(i) { | 5128 | for_each_memcg_cache_index(i) { |
5112 | struct kmem_cache *c = cache_from_memcg(s, i); | 5129 | struct kmem_cache *c = cache_from_memcg(s, i); |
5113 | /* | ||
5114 | * This function's return value is determined by the | ||
5115 | * parent cache only | ||
5116 | */ | ||
5117 | if (c) | 5130 | if (c) |
5118 | attribute->store(c, buf, len); | 5131 | attribute->store(c, buf, len); |
5119 | } | 5132 | } |