--- fs/namei.c | 6 ++++++ 1 file changed, 6 insertions(+) Index: b/fs/namei.c =================================================================== --- a/fs/namei.c 2008-06-09 13:33:25.000000000 +0200 +++ b/fs/namei.c 2008-06-09 13:35:57.000000000 +0200 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -1566,6 +1567,11 @@ struct dentry *lock_rename(struct dentry } mutex_lock_nested(&p1->d_inode->i_mutex, I_MUTEX_PARENT); + if (!strcmp(current->comm, "test_deadlock")) { + unsigned long now = jiffies; + while (jiffies - now < 8 * HZ) + cpu_relax(); + } mutex_lock_nested(&p2->d_inode->i_mutex, I_MUTEX_CHILD); return NULL; }