aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/mmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ecryptfs/mmap.c')
-rw-r--r--fs/ecryptfs/mmap.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index 270f42ae7c0d..bea998a25afd 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -82,6 +82,19 @@ out:
82 return rc; 82 return rc;
83} 83}
84 84
85static void strip_xattr_flag(char *page_virt,
86 struct ecryptfs_crypt_stat *crypt_stat)
87{
88 if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) {
89 size_t written;
90
91 crypt_stat->flags &= ~ECRYPTFS_METADATA_IN_XATTR;
92 ecryptfs_write_crypt_stat_flags(page_virt, crypt_stat,
93 &written);
94 crypt_stat->flags |= ECRYPTFS_METADATA_IN_XATTR;
95 }
96}
97
85/** 98/**
86 * Header Extent: 99 * Header Extent:
87 * Octets 0-7: Unencrypted file size (big-endian) 100 * Octets 0-7: Unencrypted file size (big-endian)
@@ -136,6 +149,7 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page,
136 149
137 rc = ecryptfs_read_xattr_region( 150 rc = ecryptfs_read_xattr_region(
138 page_virt, page->mapping->host); 151 page_virt, page->mapping->host);
152 strip_xattr_flag(page_virt + 16, crypt_stat);
139 ecryptfs_write_header_metadata(page_virt + 20, 153 ecryptfs_write_header_metadata(page_virt + 20,
140 crypt_stat, 154 crypt_stat,
141 &written); 155 &written);