Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233012
b: refs/heads/master
c: 3a90983
h: refs/heads/master
v: v3
  • Loading branch information
Yan, Zheng authored and Chris Mason committed Feb 7, 2011
1 parent 7e0497e commit 19a79d0
Show file tree
Hide file tree
Showing 2 changed files with 5 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: 8e4eef7a60eeca0fe7503e5cbd3b24ff4941c732
refs/heads/master: 3a90983dbdcb2f4f48c0d771d8e5b4d88f27fae6
8 changes: 4 additions & 4 deletions trunk/fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -991,8 +991,8 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,
size_t write_bytes = min(iov_iter_count(&i),
nrptrs * (size_t)PAGE_CACHE_SIZE -
offset);
size_t num_pages = (write_bytes + PAGE_CACHE_SIZE - 1) >>
PAGE_CACHE_SHIFT;
size_t num_pages = (write_bytes + offset +
PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;

WARN_ON(num_pages > nrptrs);
memset(pages, 0, sizeof(struct page *) * nrptrs);
Expand Down Expand Up @@ -1022,8 +1022,8 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,

copied = btrfs_copy_from_user(pos, num_pages,
write_bytes, pages, &i);
dirty_pages = (copied + PAGE_CACHE_SIZE - 1) >>
PAGE_CACHE_SHIFT;
dirty_pages = (copied + offset + PAGE_CACHE_SIZE - 1) >>
PAGE_CACHE_SHIFT;

if (num_pages > dirty_pages) {
if (copied > 0)
Expand Down

0 comments on commit 19a79d0

Please sign in to comment.