From: Tejun Heo <tj@kernel.org>
To: Xiaotian Feng <xtfeng@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Xiaotian Feng <dannyfeng@tencent.com>,
Neela Syam Kolli <megaraidlinux@lsi.com>,
"James E.J. Bottomley" <JBottomley@parallels.com>,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH] megaraid: fix use of delayed work
Date: Tue, 4 Dec 2012 07:39:39 -0800 [thread overview]
Message-ID: <20121204153939.GD3885@mtj.dyndns.org> (raw)
In-Reply-To: <1354620834-2953-1-git-send-email-xtfeng@gmail.com>
On Tue, Dec 04, 2012 at 07:33:54PM +0800, Xiaotian Feng wrote:
> megaraid use INIT_WORK to declare a hotplug_work, but cast the hotplug_work
> from work_struct to delayed_work and schedule_delayed_work on it. This is
> very dangerous, as other part of delayed_work might be kernel memories allocated
> by others.
>
> With commit 8852aac, schedule_delayed_work() will check dwork->timer before
> queue_work, this will cause megaraid code to hit the BUG_ON in workqueue code.
> Change megaraid code to use delayed work.
>
> Signed-off-by: Xiaotian Feng <dannyfeng@tencent.com>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Neela Syam Kolli <megaraidlinux@lsi.com>
> Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
> Cc: linux-scsi@vger.kernel.org
Urgh... what the.... Didn't see that one coming. I'm gonna push this
to Linus through the workqueue tree.
Thanks for the fix.
--
tejun
next prev parent reply other threads:[~2012-12-04 15:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-04 11:33 [PATCH] megaraid: fix use of delayed work Xiaotian Feng
2012-12-04 15:39 ` Tejun Heo [this message]
2012-12-04 15:57 ` Tejun Heo
2012-12-04 15:54 ` [PATCH 1/2] megaraid: fix BUG_ON() from incorrect " Tejun Heo
2012-12-04 15:55 ` [PATCH 2/2] workqueue: convert BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s Tejun Heo
2012-12-05 11:02 ` [PATCH 1/2] megaraid: fix BUG_ON() from incorrect use of delayed work Daniel Vacek
2012-12-05 11:16 ` Daniel Vacek
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=20121204153939.GD3885@mtj.dyndns.org \
--to=tj@kernel.org \
--cc=JBottomley@parallels.com \
--cc=dannyfeng@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=megaraidlinux@lsi.com \
--cc=xtfeng@gmail.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).