]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix binfmt_misc locking
authorAndrew Morton <akpm@osdl.org>
Mon, 27 Oct 2003 05:37:04 +0000 (21:37 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 27 Oct 2003 05:37:04 +0000 (21:37 -0800)
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
mm/filemap.c

index 8b1b6e03c36fce2e8c91fe7985b4ba908fde0ee4..0eae1415ccd282d30ce82be844270b05cc0a727f 100644 (file)
@@ -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);
 
index 4dc696e3fbcb9f3d09c4874e7f1394a778279a7c..7891fef5399b751f1731d22f95efde385b310179 100644 (file)
@@ -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)
  */
 
 /*