Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 126245
b: refs/heads/master
c: 91bf189
h: refs/heads/master
i:
  126243: b11702d
v: v3
  • Loading branch information
Roel Kluin authored and Linus Torvalds committed Jan 6, 2009
1 parent e928b5a commit 8b98c58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b555749aac87d7c2637f153e44bd77c7fdf4c65b
refs/heads/master: 91bf189c3a766927694ce9de7d545e96b23f20fc
12 changes: 8 additions & 4 deletions trunk/fs/hugetlbfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ static ssize_t hugetlbfs_read(struct file *filp, char __user *buf,
for (;;) {
struct page *page;
unsigned long nr, ret;
int ra;

/* nr is the maximum number of bytes to copy from this page */
nr = huge_page_size(h);
Expand All @@ -274,16 +275,19 @@ static ssize_t hugetlbfs_read(struct file *filp, char __user *buf,
*/
ret = len < nr ? len : nr;
if (clear_user(buf, ret))
ret = -EFAULT;
ra = -EFAULT;
else
ra = 0;
} else {
/*
* We have the page, copy it to user space buffer.
*/
ret = hugetlbfs_read_actor(page, offset, buf, len, nr);
ra = hugetlbfs_read_actor(page, offset, buf, len, nr);
ret = ra;
}
if (ret < 0) {
if (ra < 0) {
if (retval == 0)
retval = ret;
retval = ra;
if (page)
page_cache_release(page);
goto out;
Expand Down

0 comments on commit 8b98c58

Please sign in to comment.