Make sure that highmem pages are not added to symlink page cache
inode_nohighmem() is sufficient to make sure that page_get_link() won't try to allocate a highmem page. Moreover, it is sufficient to make sure that page_symlink/__page_symlink won't do the same thing. However, any filesystem that manually preseeds the symlink's page cache upon symlink(2) needs to make sure that the page it inserts there won't be a highmem one. Fortunately, only nfs and shmem have run afoul of that... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -1894,15 +1894,14 @@ int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
|
||||
attr.ia_mode = S_IFLNK | S_IRWXUGO;
|
||||
attr.ia_valid = ATTR_MODE;
|
||||
|
||||
page = alloc_page(GFP_HIGHUSER);
|
||||
page = alloc_page(GFP_USER);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
|
||||
kaddr = kmap_atomic(page);
|
||||
kaddr = page_address(page);
|
||||
memcpy(kaddr, symname, pathlen);
|
||||
if (pathlen < PAGE_SIZE)
|
||||
memset(kaddr + pathlen, 0, PAGE_SIZE - pathlen);
|
||||
kunmap_atomic(kaddr);
|
||||
|
||||
trace_nfs_symlink_enter(dir, dentry);
|
||||
error = NFS_PROTO(dir)->symlink(dir, dentry, page, pathlen, &attr);
|
||||
|
Reference in New Issue
Block a user