From: Mark Fasheh Date: Fri, 20 Oct 2006 21:55:54 +0000 (-0700) Subject: configfs: mutex_lock_nested() fix X-Git-Tag: v2.6.20-rc1~34^2~40^2~4^2~7 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55ed16029d597622db8121270e687373b5e31722;p=linux-2.6 configfs: mutex_lock_nested() fix configfs_unregister_subsystem() nests a pair of inode i_mutex acquisitions, and thus needs annotation via mutex_lock_nested(). Signed-off-by: Mark Fasheh --- diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 8a3b6a1a6a..452cfd1e78 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -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"); }