aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-08-19 21:02:56 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-19 21:02:56 -0400
commitcc314eef0128a807e50fa03baf2d0abc0647952c (patch)
tree8e38db1be28006894915273b3f3cb3beaa6efda3 /include/linux/fs.h
parent2fb1e3086df9b454538491fba8121298da37cd23 (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 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f9adf75fd9b4..67e6732d4fdc 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -993,8 +993,8 @@ struct inode_operations {
993 int (*rename) (struct inode *, struct dentry *, 993 int (*rename) (struct inode *, struct dentry *,
994 struct inode *, struct dentry *); 994 struct inode *, struct dentry *);
995 int (*readlink) (struct dentry *, char __user *,int); 995 int (*readlink) (struct dentry *, char __user *,int);
996 int (*follow_link) (struct dentry *, struct nameidata *); 996 void * (*follow_link) (struct dentry *, struct nameidata *);
997 void (*put_link) (struct dentry *, struct nameidata *); 997 void (*put_link) (struct dentry *, struct nameidata *, void *);
998 void (*truncate) (struct inode *); 998 void (*truncate) (struct inode *);
999 int (*permission) (struct inode *, int, struct nameidata *); 999 int (*permission) (struct inode *, int, struct nameidata *);
1000 int (*setattr) (struct dentry *, struct iattr *); 1000 int (*setattr) (struct dentry *, struct iattr *);
@@ -1602,8 +1602,8 @@ extern struct file_operations generic_ro_fops;
1602extern int vfs_readlink(struct dentry *, char __user *, int, const char *); 1602extern int vfs_readlink(struct dentry *, char __user *, int, const char *);
1603extern int vfs_follow_link(struct nameidata *, const char *); 1603extern int vfs_follow_link(struct nameidata *, const char *);
1604extern int page_readlink(struct dentry *, char __user *, int); 1604extern int page_readlink(struct dentry *, char __user *, int);
1605extern int page_follow_link_light(struct dentry *, struct nameidata *); 1605extern void *page_follow_link_light(struct dentry *, struct nameidata *);
1606extern void page_put_link(struct dentry *, struct nameidata *); 1606extern void page_put_link(struct dentry *, struct nameidata *, void *);
1607extern int page_symlink(struct inode *inode, const char *symname, int len); 1607extern int page_symlink(struct inode *inode, const char *symname, int len);
1608extern struct inode_operations page_symlink_inode_operations; 1608extern struct inode_operations page_symlink_inode_operations;
1609extern int generic_readlink(struct dentry *, char __user *, int); 1609extern int generic_readlink(struct dentry *, char __user *, int);