diff options
author | Xiaotian Feng <xtfeng@gmail.com> | 2012-12-04 19:33:54 +0800 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-12-04 07:29:47 -0800 |
commit | c1d390d8e6128b050f0f66b1c33d390760deb3f4 (patch) | |
tree | edbdf78f783da84eeacb7041a8b64d3096ce1f81 /drivers/scsi/megaraid/megaraid_sas.h | |
parent | 8852aac25e79e38cc6529f20298eed154f60b574 (diff) |
megaraid: fix BUG_ON() from incorrect use of delayed work
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 ("workqueue: mod_delayed_work_on() shouldn't queue
timer on 0 delay"), schedule_delayed_work() will check dwork->timer
before queue_work even when @delay is 0, this causes 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>
Signed-off-by: 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
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_sas.h')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 16b7a72a70c4..3b2365c8eab2 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -1276,7 +1276,7 @@ struct megasas_evt_detail { } __attribute__ ((packed)); struct megasas_aen_event { - struct work_struct hotplug_work; + struct delayed_work hotplug_work; struct megasas_instance *instance; }; |