diff options
-rw-r--r-- | fs/namei.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c index ab441af4196b..9ed5e2818f80 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2786,13 +2786,16 @@ int vfs_follow_link(struct nameidata *nd, const char *link) | |||
2786 | /* get the link contents into pagecache */ | 2786 | /* get the link contents into pagecache */ |
2787 | static char *page_getlink(struct dentry * dentry, struct page **ppage) | 2787 | static char *page_getlink(struct dentry * dentry, struct page **ppage) |
2788 | { | 2788 | { |
2789 | struct page * page; | 2789 | char *kaddr; |
2790 | struct page *page; | ||
2790 | struct address_space *mapping = dentry->d_inode->i_mapping; | 2791 | struct address_space *mapping = dentry->d_inode->i_mapping; |
2791 | page = read_mapping_page(mapping, 0, NULL); | 2792 | page = read_mapping_page(mapping, 0, NULL); |
2792 | if (IS_ERR(page)) | 2793 | if (IS_ERR(page)) |
2793 | return (char*)page; | 2794 | return (char*)page; |
2794 | *ppage = page; | 2795 | *ppage = page; |
2795 | return kmap(page); | 2796 | kaddr = kmap(page); |
2797 | nd_terminate_link(kaddr, dentry->d_inode->i_size, PAGE_SIZE - 1); | ||
2798 | return kaddr; | ||
2796 | } | 2799 | } |
2797 | 2800 | ||
2798 | int page_readlink(struct dentry *dentry, char __user *buffer, int buflen) | 2801 | int page_readlink(struct dentry *dentry, char __user *buffer, int buflen) |