diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2015-11-17 01:07:57 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-08 22:41:36 -0500 |
| commit | 21fc61c73c3903c4c312d0802da01ec2b323d174 (patch) | |
| tree | a26c29e3fbb766f00b023724e9e5b8b9bba9b879 /fs/hpfs | |
| parent | aa80deab33a8fb180e718f5e45514db19aade165 (diff) | |
don't put symlink bodies in pagecache into highmem
kmap() in page_follow_link_light() needed to go - allowing to hold
an arbitrary number of kmaps for long is a great way to deadlocking
the system.
new helper (inode_nohighmem(inode)) needs to be used for pagecache
symlinks inodes; done for all in-tree cases. page_follow_link_light()
instrumented to yell about anything missed.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hpfs')
| -rw-r--r-- | fs/hpfs/inode.c | 1 | ||||
| -rw-r--r-- | fs/hpfs/namei.c | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index 933c73780813..1f3c6d76200b 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c | |||
| @@ -77,6 +77,7 @@ void hpfs_read_inode(struct inode *i) | |||
| 77 | kfree(ea); | 77 | kfree(ea); |
| 78 | i->i_mode = S_IFLNK | 0777; | 78 | i->i_mode = S_IFLNK | 0777; |
| 79 | i->i_op = &page_symlink_inode_operations; | 79 | i->i_op = &page_symlink_inode_operations; |
| 80 | inode_nohighmem(i); | ||
| 80 | i->i_data.a_ops = &hpfs_symlink_aops; | 81 | i->i_data.a_ops = &hpfs_symlink_aops; |
| 81 | set_nlink(i, 1); | 82 | set_nlink(i, 1); |
| 82 | i->i_size = ea_size; | 83 | i->i_size = ea_size; |
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index ae4d5a1fa4c9..506765afa1a3 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c | |||
| @@ -332,6 +332,7 @@ static int hpfs_symlink(struct inode *dir, struct dentry *dentry, const char *sy | |||
| 332 | result->i_blocks = 1; | 332 | result->i_blocks = 1; |
| 333 | set_nlink(result, 1); | 333 | set_nlink(result, 1); |
| 334 | result->i_size = strlen(symlink); | 334 | result->i_size = strlen(symlink); |
| 335 | inode_nohighmem(result); | ||
| 335 | result->i_op = &page_symlink_inode_operations; | 336 | result->i_op = &page_symlink_inode_operations; |
| 336 | result->i_data.a_ops = &hpfs_symlink_aops; | 337 | result->i_data.a_ops = &hpfs_symlink_aops; |
| 337 | 338 | ||
| @@ -500,7 +501,7 @@ out: | |||
| 500 | 501 | ||
| 501 | static int hpfs_symlink_readpage(struct file *file, struct page *page) | 502 | static int hpfs_symlink_readpage(struct file *file, struct page *page) |
| 502 | { | 503 | { |
| 503 | char *link = kmap(page); | 504 | char *link = page_address(page); |
| 504 | struct inode *i = page->mapping->host; | 505 | struct inode *i = page->mapping->host; |
| 505 | struct fnode *fnode; | 506 | struct fnode *fnode; |
| 506 | struct buffer_head *bh; | 507 | struct buffer_head *bh; |
| @@ -516,14 +517,12 @@ static int hpfs_symlink_readpage(struct file *file, struct page *page) | |||
| 516 | goto fail; | 517 | goto fail; |
| 517 | hpfs_unlock(i->i_sb); | 518 | hpfs_unlock(i->i_sb); |
| 518 | SetPageUptodate(page); | 519 | SetPageUptodate(page); |
| 519 | kunmap(page); | ||
| 520 | unlock_page(page); | 520 | unlock_page(page); |
| 521 | return 0; | 521 | return 0; |
| 522 | 522 | ||
| 523 | fail: | 523 | fail: |
| 524 | hpfs_unlock(i->i_sb); | 524 | hpfs_unlock(i->i_sb); |
| 525 | SetPageError(page); | 525 | SetPageError(page); |
| 526 | kunmap(page); | ||
| 527 | unlock_page(page); | 526 | unlock_page(page); |
| 528 | return err; | 527 | return err; |
| 529 | } | 528 | } |
