From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, vbabka@suse.cz, peterz@infradead.org,
ojeda@kernel.org, ndesaulniers@google.com, nathan@kernel.org,
linux@rasmusvillemoes.dk, keescook@chromium.org,
jpoimboe@kernel.org, isabbasso@riseup.net,
dan.j.williams@intel.com, akinobu.mita@gmail.com,
weiyongjun1@huawei.com, akpm@linux-foundation.org
Subject: [merged mm-nonmm-stable] fault-injection-make-stacktrace-filter-works-as-expected.patch removed from -mm tree
Date: Thu, 15 Dec 2022 16:41:16 -0800 [thread overview]
Message-ID: <20221216004117.73EDCC433F2@smtp.kernel.org> (raw)
The quilt patch titled
Subject: fault-injection: make stacktrace filter works as expected
has been removed from the -mm tree. Its filename was
fault-injection-make-stacktrace-filter-works-as-expected.patch
This patch was dropped because it was merged into the mm-nonmm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Wei Yongjun <weiyongjun1@huawei.com>
Subject: fault-injection: make stacktrace filter works as expected
Date: Wed, 17 Aug 2022 08:03:32 +0000
stacktrace filter is checked after others, such as fail-nth, interval and
probability. This make it doesn't work well as expected.
Fix to running stacktrace filter before other filters. It will speed up
fault inject testing for driver modules.
Link: https://lkml.kernel.org/r/20220817080332.1052710-5-weiyongjun1@huawei.com
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Isabella Basso <isabbasso@riseup.net>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
lib/fault-inject.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
--- a/lib/fault-inject.c~fault-injection-make-stacktrace-filter-works-as-expected
+++ a/lib/fault-inject.c
@@ -102,10 +102,16 @@ static inline bool fail_stacktrace(struc
bool should_fail_ex(struct fault_attr *attr, ssize_t size, int flags)
{
+ bool stack_checked = false;
+
if (in_task()) {
unsigned int fail_nth = READ_ONCE(current->fail_nth);
if (fail_nth) {
+ if (!fail_stacktrace(attr))
+ return false;
+
+ stack_checked = true;
fail_nth--;
WRITE_ONCE(current->fail_nth, fail_nth);
if (!fail_nth)
@@ -125,6 +131,9 @@ bool should_fail_ex(struct fault_attr *a
if (atomic_read(&attr->times) == 0)
return false;
+ if (!stack_checked && !fail_stacktrace(attr))
+ return false;
+
if (atomic_read(&attr->space) > size) {
atomic_sub(size, &attr->space);
return false;
@@ -139,9 +148,6 @@ bool should_fail_ex(struct fault_attr *a
if (attr->probability <= get_random_u32_below(100))
return false;
- if (!fail_stacktrace(attr))
- return false;
-
fail:
if (!(flags & FAULT_NOWARN))
fail_dump(attr);
_
Patches currently in -mm which might be from weiyongjun1@huawei.com are
next reply other threads:[~2022-12-16 0:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-16 0:41 Andrew Morton [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-11-15 22:31 [merged mm-nonmm-stable] fault-injection-make-stacktrace-filter-works-as-expected.patch removed from -mm tree Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221216004117.73EDCC433F2@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=akinobu.mita@gmail.com \
--cc=dan.j.williams@intel.com \
--cc=isabbasso@riseup.net \
--cc=jpoimboe@kernel.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mm-commits@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=ojeda@kernel.org \
--cc=peterz@infradead.org \
--cc=vbabka@suse.cz \
--cc=weiyongjun1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.