|
@@ -193,11 +193,7 @@ static int ecryptfs_readpage(struct file *file, struct page *page)
|
|
&ecryptfs_inode_to_private(page->mapping->host)->crypt_stat;
|
|
&ecryptfs_inode_to_private(page->mapping->host)->crypt_stat;
|
|
int rc = 0;
|
|
int rc = 0;
|
|
|
|
|
|
- if (!crypt_stat
|
|
|
|
- || !(crypt_stat->flags & ECRYPTFS_ENCRYPTED)
|
|
|
|
- || (crypt_stat->flags & ECRYPTFS_NEW_FILE)) {
|
|
|
|
- ecryptfs_printk(KERN_DEBUG,
|
|
|
|
- "Passing through unencrypted page\n");
|
|
|
|
|
|
+ if (!crypt_stat || !(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) {
|
|
rc = ecryptfs_read_lower_page_segment(page, page->index, 0,
|
|
rc = ecryptfs_read_lower_page_segment(page, page->index, 0,
|
|
PAGE_CACHE_SIZE,
|
|
PAGE_CACHE_SIZE,
|
|
page->mapping->host);
|
|
page->mapping->host);
|
|
@@ -295,8 +291,7 @@ static int ecryptfs_write_begin(struct file *file,
|
|
struct ecryptfs_crypt_stat *crypt_stat =
|
|
struct ecryptfs_crypt_stat *crypt_stat =
|
|
&ecryptfs_inode_to_private(mapping->host)->crypt_stat;
|
|
&ecryptfs_inode_to_private(mapping->host)->crypt_stat;
|
|
|
|
|
|
- if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)
|
|
|
|
- || (crypt_stat->flags & ECRYPTFS_NEW_FILE)) {
|
|
|
|
|
|
+ if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) {
|
|
rc = ecryptfs_read_lower_page_segment(
|
|
rc = ecryptfs_read_lower_page_segment(
|
|
page, index, 0, PAGE_CACHE_SIZE, mapping->host);
|
|
page, index, 0, PAGE_CACHE_SIZE, mapping->host);
|
|
if (rc) {
|
|
if (rc) {
|
|
@@ -487,12 +482,6 @@ static int ecryptfs_write_end(struct file *file,
|
|
&ecryptfs_inode_to_private(ecryptfs_inode)->crypt_stat;
|
|
&ecryptfs_inode_to_private(ecryptfs_inode)->crypt_stat;
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
- if (crypt_stat->flags & ECRYPTFS_NEW_FILE) {
|
|
|
|
- ecryptfs_printk(KERN_DEBUG, "ECRYPTFS_NEW_FILE flag set in "
|
|
|
|
- "crypt_stat at memory location [%p]\n", crypt_stat);
|
|
|
|
- crypt_stat->flags &= ~(ECRYPTFS_NEW_FILE);
|
|
|
|
- } else
|
|
|
|
- ecryptfs_printk(KERN_DEBUG, "Not a new file\n");
|
|
|
|
ecryptfs_printk(KERN_DEBUG, "Calling fill_zeros_to_end_of_page"
|
|
ecryptfs_printk(KERN_DEBUG, "Calling fill_zeros_to_end_of_page"
|
|
"(page w/ index = [0x%.16lx], to = [%d])\n", index, to);
|
|
"(page w/ index = [0x%.16lx], to = [%d])\n", index, to);
|
|
if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) {
|
|
if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) {
|