From a1e10d3ab44d326137be03a7516998e86e975fff Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 26 Oct 2003 21:37:04 -0800 Subject: [PATCH] [PATCH] Fix binfmt_misc locking This fixes a sleep-in-spinlock bug for binfmt_misc registration. That lock is purely for the list, not for the dentry. --- fs/binfmt_misc.c | 2 +- mm/filemap.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 8b1b6e03c36fc..0eae1415ccd28 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -529,8 +529,8 @@ static ssize_t bm_register_write(struct file *file, const char *buffer, inode->u.generic_ip = e; inode->i_fop = &bm_entry_operations; - write_lock(&entries_lock); d_instantiate(dentry, inode); + write_lock(&entries_lock); list_add(&e->list, &entries); write_unlock(&entries_lock); diff --git a/mm/filemap.c b/mm/filemap.c index 4dc696e3fbcb9..7891fef5399b7 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -82,6 +82,9 @@ * ->private_lock (try_to_unmap_one) * ->page_lock (try_to_unmap_one) * ->zone.lru_lock (follow_page->mark_page_accessed) + * + * ->task->proc_lock + * ->dcache_lock (proc_pid_lookup) */ /* -- 2.53.0