From: Matthew Wilcox <mawilcox@microsoft.com>
To: Johannes Weiner <hannes@cmpxchg.org>,
Matthew Wilcox <mawilcox@linuxonhyperv.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] radix-tree: Fix private list warnings
Date: Sat, 14 Jan 2017 21:31:51 +0000 [thread overview]
Message-ID: <SN1PR21MB0045B279EAEDF64A9D76B4FDCB7B0@SN1PR21MB0045.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20170114154231.GA26139@cmpxchg.org>
From: Johannes Weiner [mailto:hannes@cmpxchg.org]
> On Thu, Jan 12, 2017 at 05:28:23PM -0800, Matthew Wilcox wrote:
> > The newly introduced warning in radix_tree_free_nodes() was testing the
> > wrong variable; it should have been 'old' instead of 'node'. Rather
> > than replace that one instance, I noticed that we can simply put the
> > WARN_ON_ONCE in radix_tree_node_free() and it will be just as effective.
> >
> > Fixes: ea07b862ac8e ("mm: workingset: fix use-after-free in shadow node
> shrinker")
> > Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
>
> Thanks for the fix in radix_tree_free_nodes(). But I intentionally
> spread out the warnings to retain the line numbers. The inlining in
> that code will obscure which tree operation ends up triggering.
The backtrace should make that fairly obvious though; even if radix_tree_node_free() gets inlined, the caller of radix_tree_free_nodes() probably doesn't also call radix_tree_shrink() or delete_node(). You're really looking for the caller in the backtrace that's outside of radix-tree.c.
By the way, if you'd run the radix tree test-suite, the WARN_ON_ONCE would have triggered (that's how I spotted the bug). The test-suite is getting pretty useful these days; would you mind running it in future?
next prev parent reply other threads:[~2017-01-14 21:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 1:28 [PATCH] radix-tree: Fix private list warnings Matthew Wilcox
2017-01-14 15:42 ` Johannes Weiner
2017-01-14 21:31 ` Matthew Wilcox [this message]
2017-01-15 0:57 ` Johannes Weiner
2017-01-18 16:37 ` Johannes Weiner
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=SN1PR21MB0045B279EAEDF64A9D76B4FDCB7B0@SN1PR21MB0045.namprd21.prod.outlook.com \
--to=mawilcox@microsoft.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mawilcox@linuxonhyperv.com \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).