@@ -88,6 +88,8 @@ static int afs_inode_map_status(struct afs_vnode *vnode, struct key *key)
inode->i_mode = S_IFDIR | vnode->status.mode;
inode->i_op = &afs_mntpt_inode_operations;
inode->i_fop = &afs_mntpt_file_operations;
+ /* Not a real symlink, don't follow */
+ inode->i_opflags |= IOP_NOFOLLOW;
}
}
@@ -33,7 +33,8 @@ const struct file_operations afs_mntpt_file_operations = {
const struct inode_operations afs_mntpt_inode_operations = {
.lookup = afs_mntpt_lookup,
- .readlink = page_readlink,
+ .get_link = page_get_link,
+ .readlink = generic_readlink,
.getattr = afs_getattr,
};
This will allow us to move the generic readlink logic into the VFS and get rid of the readlink method. AFS mountpoints seem to be special symlinks that can be read but not followed. So add IOP_NOFOLLOW to i_opflags and use page_get_link + generic_readlink instead of page_readlink. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Cc: David Howells <dhowells@redhat.com> --- fs/afs/inode.c | 2 ++ fs/afs/mntpt.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)