Skip to content

Commit

Permalink
ceph: fix direct io truncate offset
Browse files Browse the repository at this point in the history
truncate_inode_pages_range wants the end offset to align with the last byte
in a page.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed May 3, 2010
1 parent ae18756 commit 5c6a2cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ceph/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,8 @@ static ssize_t ceph_sync_write(struct file *file, const char __user *data,
* throw out any page cache pages in this range. this
* may block.
*/
truncate_inode_pages_range(inode->i_mapping, pos, pos+len);
truncate_inode_pages_range(inode->i_mapping, pos,
(pos+len) | (PAGE_CACHE_SIZE-1));
} else {
pages = alloc_page_vector(num_pages);
if (IS_ERR(pages)) {
Expand Down

0 comments on commit 5c6a2cd

Please sign in to comment.