diff options
author | Michael Halcrow <mhalcrow@us.ibm.com> | 2007-02-12 03:53:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:37 -0500 |
commit | 0a9ac38246b11892ad20a1eb9deb67adf8c0db2f (patch) | |
tree | a5521698784e54263acda35226522e1d3348f786 | |
parent | e2bd99ec5c0e20ed6aeb079fa8f975c2dcd78a2c (diff) |
[PATCH] eCryptfs: add flush_dcache_page() calls
Call flush_dcache_page() after modifying a pagecache by hand.
Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/ecryptfs/mmap.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c index 3014aa719953..3a6f65c3f14f 100644 --- a/fs/ecryptfs/mmap.c +++ b/fs/ecryptfs/mmap.c | |||
@@ -238,7 +238,9 @@ int ecryptfs_do_readpage(struct file *file, struct page *page, | |||
238 | lower_page_data = kmap_atomic(lower_page, KM_USER1); | 238 | lower_page_data = kmap_atomic(lower_page, KM_USER1); |
239 | memcpy(page_data, lower_page_data, PAGE_CACHE_SIZE); | 239 | memcpy(page_data, lower_page_data, PAGE_CACHE_SIZE); |
240 | kunmap_atomic(lower_page_data, KM_USER1); | 240 | kunmap_atomic(lower_page_data, KM_USER1); |
241 | flush_dcache_page(lower_page); | ||
241 | kunmap_atomic(page_data, KM_USER0); | 242 | kunmap_atomic(page_data, KM_USER0); |
243 | flush_dcache_page(page); | ||
242 | rc = 0; | 244 | rc = 0; |
243 | out: | 245 | out: |
244 | if (likely(lower_page)) | 246 | if (likely(lower_page)) |
@@ -322,6 +324,7 @@ static int ecryptfs_readpage(struct file *file, struct page *page) | |||
322 | set_header_info(page_virt, crypt_stat); | 324 | set_header_info(page_virt, crypt_stat); |
323 | } | 325 | } |
324 | kunmap_atomic(page_virt, KM_USER0); | 326 | kunmap_atomic(page_virt, KM_USER0); |
327 | flush_dcache_page(page); | ||
325 | if (rc) { | 328 | if (rc) { |
326 | printk(KERN_ERR "Error reading xattr " | 329 | printk(KERN_ERR "Error reading xattr " |
327 | "region\n"); | 330 | "region\n"); |
@@ -382,6 +385,7 @@ static int fill_zeros_to_end_of_page(struct page *page, unsigned int to) | |||
382 | memset((page_virt + end_byte_in_page), 0, | 385 | memset((page_virt + end_byte_in_page), 0, |
383 | (PAGE_CACHE_SIZE - end_byte_in_page)); | 386 | (PAGE_CACHE_SIZE - end_byte_in_page)); |
384 | kunmap_atomic(page_virt, KM_USER0); | 387 | kunmap_atomic(page_virt, KM_USER0); |
388 | flush_dcache_page(page); | ||
385 | out: | 389 | out: |
386 | return 0; | 390 | return 0; |
387 | } | 391 | } |
@@ -456,6 +460,7 @@ static int ecryptfs_write_inode_size_to_header(struct file *lower_file, | |||
456 | header_virt = kmap_atomic(header_page, KM_USER0); | 460 | header_virt = kmap_atomic(header_page, KM_USER0); |
457 | memcpy(header_virt, &file_size, sizeof(u64)); | 461 | memcpy(header_virt, &file_size, sizeof(u64)); |
458 | kunmap_atomic(header_virt, KM_USER0); | 462 | kunmap_atomic(header_virt, KM_USER0); |
463 | flush_dcache_page(header_page); | ||
459 | rc = lower_a_ops->commit_write(lower_file, header_page, 0, 8); | 464 | rc = lower_a_ops->commit_write(lower_file, header_page, 0, 8); |
460 | if (rc < 0) | 465 | if (rc < 0) |
461 | ecryptfs_printk(KERN_ERR, "Error commiting header page " | 466 | ecryptfs_printk(KERN_ERR, "Error commiting header page " |
@@ -742,6 +747,7 @@ int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros) | |||
742 | tmp_page_virt = kmap_atomic(tmp_page, KM_USER0); | 747 | tmp_page_virt = kmap_atomic(tmp_page, KM_USER0); |
743 | memset(((char *)tmp_page_virt + start), 0, num_zeros); | 748 | memset(((char *)tmp_page_virt + start), 0, num_zeros); |
744 | kunmap_atomic(tmp_page_virt, KM_USER0); | 749 | kunmap_atomic(tmp_page_virt, KM_USER0); |
750 | flush_dcache_page(tmp_page); | ||
745 | rc = ecryptfs_commit_write(file, tmp_page, start, start + num_zeros); | 751 | rc = ecryptfs_commit_write(file, tmp_page, start, start + num_zeros); |
746 | if (rc < 0) { | 752 | if (rc < 0) { |
747 | ecryptfs_printk(KERN_ERR, "Error attempting to write zero's " | 753 | ecryptfs_printk(KERN_ERR, "Error attempting to write zero's " |