From: Wu Fengguang <fengguang.wu@intel.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Kenneth <liguozhu@huawei.com>,
greg@kroah.com, linux-kernel@vger.kernel.org,
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
linux-mm <linux-mm@kvack.org>
Subject: Re: Problem with debugfs
Date: Tue, 21 Sep 2010 16:04:59 +0800 [thread overview]
Message-ID: <20100921080459.GA29540@localhost> (raw)
In-Reply-To: <31aed4ad96866a97dc791186303c5719.squirrel@www.firstfloor.org>
On Tue, Sep 21, 2010 at 09:31:58AM +0200, Andi Kleen wrote:
> x
>
> >> I'm sorry I had not checked the git before sending my last mail.
> >>
> >> For the problem I mention, consider this scenarios:
> >>
> >> 1. mm/hwpoinson-inject.c create a debugfs file with
> >> debugfs_create_u64("corrupt-filter-flags-mask", ...,
> >> &hwpoison_filter_flags_mask)
> >> 2. hwpoison_filter_flags_mask is supposed to be protected by
> >> filp->priv->mutex
> >> of this file when it is accessed from user space.
> >> 3. but when it is accessed from
> >> mm/memory-failure.c:hwpoison_filter_flags,
> >> there is no way for the function to protect the operation (so it
> >> simply
> >> ignore it). This may create a competition problem.
> >>
> >> It should be a problem.
Thanks for the report. Did this show up as a real bug? What's your
use case? Or is it a theoretic concern raised when doing code review?
Yeah the hwpoison_filter_flags_* values are not referenced strictly
safe to concurrent updates. I didn't care it because the typical usage
is for hwpoison test tools to _first_ echo hwpoison_filter_flags_*
values into the debugfs and _then_ start injecting hwpoison errors.
Otherwise you cannot get reliable test results. The updated value is
guaranteed to be visible because there are file mutex UNLOCK and page
LOCK operations in between.
Thanks,
Fengguang
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-09-21 8:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100921022112.GA10336@localhost>
[not found] ` <20100921061310.GA11526@localhost>
2010-09-21 7:23 ` Problem with debugfs KOSAKI Motohiro
2010-09-21 7:31 ` Andi Kleen
2010-09-21 8:04 ` Wu Fengguang [this message]
2010-09-21 8:12 ` Andi Kleen
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=20100921080459.GA29540@localhost \
--to=fengguang.wu@intel.com \
--cc=andi@firstfloor.org \
--cc=greg@kroah.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=liguozhu@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=n-horiguchi@ah.jp.nec.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 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).