From: Sage Weil <sage@newdream.net>
Date: Thu, 22 Apr 2010 20:48:59 +0000 (-0700)
Subject: ceph: fix direct io truncate offset
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5c6a2cdb4fe8aaf6b54f022c14f13d2a12b45914;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

ceph: fix direct io truncate offset

truncate_inode_pages_range wants the end offset to align with the last byte
in a page.

Signed-off-by: Sage Weil <sage@newdream.net>
---

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 4add3d5da2c1..ed6f19721d6e 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -665,7 +665,8 @@ more:
 		 * 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)) {