WIP: update tizen_qemu_defconfig
[platform/kernel/linux-starfive.git] / mm / failslab.c
index 58df978..ffc420c 100644 (file)
@@ -16,6 +16,8 @@ static struct {
 
 bool __should_failslab(struct kmem_cache *s, gfp_t gfpflags)
 {
+       int flags = 0;
+
        /* No fault-injection for bootstrap cache */
        if (unlikely(s == kmem_cache))
                return false;
@@ -30,10 +32,16 @@ bool __should_failslab(struct kmem_cache *s, gfp_t gfpflags)
        if (failslab.cache_filter && !(s->flags & SLAB_FAILSLAB))
                return false;
 
+       /*
+        * In some cases, it expects to specify __GFP_NOWARN
+        * to avoid printing any information(not just a warning),
+        * thus avoiding deadlocks. See commit 6b9dbedbe349 for
+        * details.
+        */
        if (gfpflags & __GFP_NOWARN)
-               failslab.attr.no_warn = true;
+               flags |= FAULT_NOWARN;
 
-       return should_fail(&failslab.attr, s->object_size);
+       return should_fail_ex(&failslab.attr, s->object_size, flags);
 }
 
 static int __init setup_failslab(char *str)