lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 26 Jul 2006 08:47:21 +0200
From:	Arjan van de Ven <>
To:	Andrew Morton <>
Cc:	Ingo Molnar <>,,,,,,, Jesper Juhl <>
Subject: [patch] lockdep: annotate vfs_rmdir for filesystems that take
	i_mutex in delete_inode

On Tue, 2006-07-25 at 22:33 -0700, Andrew Morton wrote:
> On Wed, 26 Jul 2006 00:16:42 +0200
> The VFS takes the directory i_mutex and reiserfs_delete_inode() takes the
> to-be-deleted file's i_mutex.
> That's notabug and lockdep will need to be taught about it.

[2nd try, now with coffee]

This is another 3 level locking ordering:
do_rmdir takes the mutex of the parent directory
vfs_rmdir takes the mutex of the victim
shrink_dcache_parent ends up in the reiser delete_inode which takes the
mutex of dead children of the victim

the I_MUTEX ordering rules are


do_rmdir already has I_MUTEX_PARENT, delete_inode does <normal> so
vfs_rmdir needs I_MUTEX_CHILD (which is also logical)

Signed-off-by: Arjan van de Ven <>

Index: linux-2.6.18-rc2-git5/fs/namei.c
--- linux-2.6.18-rc2-git5.orig/fs/namei.c
+++ linux-2.6.18-rc2-git5/fs/namei.c
@@ -1967,7 +1967,7 @@ int vfs_rmdir(struct inode *dir, struct 
-	mutex_lock(&dentry->d_inode->i_mutex);
+	mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_CHILD);
 	if (d_mountpoint(dentry))
 		error = -EBUSY;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists