mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 17:01:14 +00:00
padata: Disable BH when taking works lock on MT path
[ Upstream commit 58329c4312
]
As the old padata code can execute in softirq context, disable
softirqs for the new padata_do_mutithreaded code too as otherwise
lockdep will get antsy.
Reported-by: syzbot+0cb5bb0f4bf9e79db3b3@syzkaller.appspotmail.com
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
db044fa740
commit
c0643d07f8
1 changed files with 4 additions and 4 deletions
|
@ -106,7 +106,7 @@ static int __init padata_work_alloc_mt(int nworks, void *data,
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
spin_lock(&padata_works_lock);
|
spin_lock_bh(&padata_works_lock);
|
||||||
/* Start at 1 because the current task participates in the job. */
|
/* Start at 1 because the current task participates in the job. */
|
||||||
for (i = 1; i < nworks; ++i) {
|
for (i = 1; i < nworks; ++i) {
|
||||||
struct padata_work *pw = padata_work_alloc();
|
struct padata_work *pw = padata_work_alloc();
|
||||||
|
@ -116,7 +116,7 @@ static int __init padata_work_alloc_mt(int nworks, void *data,
|
||||||
padata_work_init(pw, padata_mt_helper, data, 0);
|
padata_work_init(pw, padata_mt_helper, data, 0);
|
||||||
list_add(&pw->pw_list, head);
|
list_add(&pw->pw_list, head);
|
||||||
}
|
}
|
||||||
spin_unlock(&padata_works_lock);
|
spin_unlock_bh(&padata_works_lock);
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -134,12 +134,12 @@ static void __init padata_works_free(struct list_head *works)
|
||||||
if (list_empty(works))
|
if (list_empty(works))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
spin_lock(&padata_works_lock);
|
spin_lock_bh(&padata_works_lock);
|
||||||
list_for_each_entry_safe(cur, next, works, pw_list) {
|
list_for_each_entry_safe(cur, next, works, pw_list) {
|
||||||
list_del(&cur->pw_list);
|
list_del(&cur->pw_list);
|
||||||
padata_work_free(cur);
|
padata_work_free(cur);
|
||||||
}
|
}
|
||||||
spin_unlock(&padata_works_lock);
|
spin_unlock_bh(&padata_works_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void padata_parallel_worker(struct work_struct *parallel_work)
|
static void padata_parallel_worker(struct work_struct *parallel_work)
|
||||||
|
|
Loading…
Reference in a new issue