Signed-off-by: Dave Hansen <haveblue@xxxxxxxxxx> --- lxc-dave/fs/namei.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff -puN fs/namei.c~elevate-writers-vfs_link-part1 fs/namei.c --- lxc/fs/namei.c~elevate-writers-vfs_link-part1 2006-06-07 16:53:19.000000000 -0700 +++ lxc-dave/fs/namei.c 2006-06-07 16:53:19.000000000 -0700 @@ -2285,10 +2285,16 @@ asmlinkage long sys_linkat(int olddfd, c goto out_release; new_dentry = lookup_create(&nd, 0); error = PTR_ERR(new_dentry); - if (!IS_ERR(new_dentry)) { - error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry); - dput(new_dentry); - } + if (IS_ERR(new_dentry)) + goto out_unlock; + error = mnt_want_write(nd.mnt); + if (error) + goto out_dput; + error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry); + mnt_drop_write(nd.mnt); +out_dput: + dput(new_dentry); +out_unlock: mutex_unlock(&nd.dentry->d_inode->i_mutex); out_release: path_release(&nd); _ - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html