[CFR][PATCH] namei fixes (5/19)

From: Al Viro
Date: Thu May 19 2005 - 18:12:29 EST


(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: Al Viro <viro@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
----
diff -urN RC12-rc4-4/fs/namei.c RC12-rc4-5/fs/namei.c
--- RC12-rc4-4/fs/namei.c 2005-05-19 16:39:32.418043961 -0400
+++ RC12-rc4-5/fs/namei.c 2005-05-19 16:39:33.566815053 -0400
@@ -1524,8 +1524,10 @@
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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/