]> err.no Git - linux-2.6/commitdiff
configfs: mutex_lock_nested() fix
authorMark Fasheh <mark.fasheh@oracle.com>
Fri, 20 Oct 2006 21:55:54 +0000 (14:55 -0700)
committerMark Fasheh <mark.fasheh@oracle.com>
Sat, 2 Dec 2006 02:28:34 +0000 (18:28 -0800)
configfs_unregister_subsystem() nests a pair of inode i_mutex acquisitions,
and thus needs annotation via mutex_lock_nested().

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/configfs/dir.c

index 8a3b6a1a6ad139aa50ba1da2e10bdf6cd0de2980..452cfd1e785fd5b7304edc5472da66fde52f424e 100644 (file)
@@ -1176,8 +1176,9 @@ void configfs_unregister_subsystem(struct configfs_subsystem *subsys)
                return;
        }
 
-       mutex_lock(&configfs_sb->s_root->d_inode->i_mutex);
-       mutex_lock(&dentry->d_inode->i_mutex);
+       mutex_lock_nested(&configfs_sb->s_root->d_inode->i_mutex,
+                         I_MUTEX_PARENT);
+       mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_CHILD);
        if (configfs_detach_prep(dentry)) {
                printk(KERN_ERR "configfs: Tried to unregister non-empty subsystem!\n");
        }