Commit 1be4a090 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

[PATCH] namei fixes (5/19)

fix for too early mntput() in open_namei() - we pin path.mnt down for the
duration of __do_follow_link().  Otherwise we could get the fs where our
symlink lived unmounted while we were in __do_follow_link().  That would end
up with dentry of symlink staying pinned down through the fs shutdown.
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d73ffe16
......@@ -1524,8 +1524,10 @@ do_link:
error = security_inode_follow_link(path.dentry, nd);
if (error)
goto exit_dput;
mntget(path.mnt);
error = __do_follow_link(path.dentry, nd);
dput(path.dentry);
mntput(path.mnt);
path.mnt = nd->mnt;
if (error)
return error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment