diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-19 21:02:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-19 21:02:56 -0400 |
commit | cc314eef0128a807e50fa03baf2d0abc0647952c (patch) | |
tree | 8e38db1be28006894915273b3f3cb3beaa6efda3 /fs/autofs/symlink.c | |
parent | 2fb1e3086df9b454538491fba8121298da37cd23 (diff) |
Fix nasty ncpfs symlink handling bug.
This bug could cause oopses and page state corruption, because ncpfs
used the generic page-cache symlink handlign functions. But those
functions only work if the page cache is guaranteed to be "stable", ie a
page that was installed when the symlink walk was started has to still
be installed in the page cache at the end of the walk.
We could have fixed ncpfs to not use the generic helper routines, but it
is in many ways much cleaner to instead improve on the symlink walking
helper routines so that they don't require that absolute stability.
We do this by allowing "follow_link()" to return a error-pointer as a
cookie, which is fed back to the cleanup "put_link()" routine. This
also simplifies NFS symlink handling.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/autofs/symlink.c')
-rw-r--r-- | fs/autofs/symlink.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/autofs/symlink.c b/fs/autofs/symlink.c index f028396f1383..52e8772b066e 100644 --- a/fs/autofs/symlink.c +++ b/fs/autofs/symlink.c | |||
@@ -12,11 +12,12 @@ | |||
12 | 12 | ||
13 | #include "autofs_i.h" | 13 | #include "autofs_i.h" |
14 | 14 | ||
15 | static int autofs_follow_link(struct dentry *dentry, struct nameidata *nd) | 15 | /* Nothing to release.. */ |
16 | static void *autofs_follow_link(struct dentry *dentry, struct nameidata *nd) | ||
16 | { | 17 | { |
17 | char *s=((struct autofs_symlink *)dentry->d_inode->u.generic_ip)->data; | 18 | char *s=((struct autofs_symlink *)dentry->d_inode->u.generic_ip)->data; |
18 | nd_set_link(nd, s); | 19 | nd_set_link(nd, s); |
19 | return 0; | 20 | return NULL; |
20 | } | 21 | } |
21 | 22 | ||
22 | struct inode_operations autofs_symlink_inode_operations = { | 23 | struct inode_operations autofs_symlink_inode_operations = { |