The patch below is needed to avoid a deadlock on fs->lock. Without
the patch, if __emul_lookup_dentry() returns 0, we fail to reacquire
current->fs->lock and then go ahead to read_unlock() it anyhow. Bad
for your health.
I believe the bug was introduced when the fast pathwalk was reverted
in order to introduce the RCU lockless path walking.
read_unlock(¤t->fs->lock);
if (__emul_lookup_dentry(name,nd))
return 0;
+ read_lock(¤t->fs->lock);
}
nd->mnt = mntget(current->fs->rootmnt);
nd->dentry = dget(current->fs->root);