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 4add3d5..ed6f197 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)) {