|
@@ -2786,13 +2786,16 @@ int vfs_follow_link(struct nameidata *nd, const char *link)
|
|
/* get the link contents into pagecache */
|
|
/* get the link contents into pagecache */
|
|
static char *page_getlink(struct dentry * dentry, struct page **ppage)
|
|
static char *page_getlink(struct dentry * dentry, struct page **ppage)
|
|
{
|
|
{
|
|
- struct page * page;
|
|
|
|
|
|
+ char *kaddr;
|
|
|
|
+ struct page *page;
|
|
struct address_space *mapping = dentry->d_inode->i_mapping;
|
|
struct address_space *mapping = dentry->d_inode->i_mapping;
|
|
page = read_mapping_page(mapping, 0, NULL);
|
|
page = read_mapping_page(mapping, 0, NULL);
|
|
if (IS_ERR(page))
|
|
if (IS_ERR(page))
|
|
return (char*)page;
|
|
return (char*)page;
|
|
*ppage = page;
|
|
*ppage = page;
|
|
- return kmap(page);
|
|
|
|
|
|
+ kaddr = kmap(page);
|
|
|
|
+ nd_terminate_link(kaddr, dentry->d_inode->i_size, PAGE_SIZE - 1);
|
|
|
|
+ return kaddr;
|
|
}
|
|
}
|
|
|
|
|
|
int page_readlink(struct dentry *dentry, char __user *buffer, int buflen)
|
|
int page_readlink(struct dentry *dentry, char __user *buffer, int buflen)
|