|
@@ -4604,6 +4604,14 @@ static ssize_t trace_show(struct kmem_cache *s, char *buf)
|
|
static ssize_t trace_store(struct kmem_cache *s, const char *buf,
|
|
static ssize_t trace_store(struct kmem_cache *s, const char *buf,
|
|
size_t length)
|
|
size_t length)
|
|
{
|
|
{
|
|
|
|
+ /*
|
|
|
|
+ * Tracing a merged cache is going to give confusing results
|
|
|
|
+ * as well as cause other issues like converting a mergeable
|
|
|
|
+ * cache into an umergeable one.
|
|
|
|
+ */
|
|
|
|
+ if (s->refcount > 1)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
s->flags &= ~SLAB_TRACE;
|
|
s->flags &= ~SLAB_TRACE;
|
|
if (buf[0] == '1') {
|
|
if (buf[0] == '1') {
|
|
s->flags &= ~__CMPXCHG_DOUBLE;
|
|
s->flags &= ~__CMPXCHG_DOUBLE;
|
|
@@ -4721,6 +4729,9 @@ static ssize_t failslab_show(struct kmem_cache *s, char *buf)
|
|
static ssize_t failslab_store(struct kmem_cache *s, const char *buf,
|
|
static ssize_t failslab_store(struct kmem_cache *s, const char *buf,
|
|
size_t length)
|
|
size_t length)
|
|
{
|
|
{
|
|
|
|
+ if (s->refcount > 1)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
s->flags &= ~SLAB_FAILSLAB;
|
|
s->flags &= ~SLAB_FAILSLAB;
|
|
if (buf[0] == '1')
|
|
if (buf[0] == '1')
|
|
s->flags |= SLAB_FAILSLAB;
|
|
s->flags |= SLAB_FAILSLAB;
|