Parcourir la source

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>
Sage Weil il y a 15 ans
Parent
commit
5c6a2cdb4f
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      fs/ceph/file.c

+ 2 - 1
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)) {