ceph: fix direct io truncate offset
authorSage Weil <sage@newdream.net>
Thu, 22 Apr 2010 20:48:59 +0000 (13:48 -0700)
committerSage Weil <sage@newdream.net>
Mon, 3 May 2010 17:49:25 +0000 (10:49 -0700)
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>
fs/ceph/file.c

index 4add3d5da2c1ba3ee650c0d0945ce4c4ca2f68a5..ed6f19721d6e56d661ac7f11fe2aac04ba18e1a5 100644 (file)
@@ -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)) {