aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ecryptfs/mmap.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index 2ee9a3a7b68c..14e81c26c3ed 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -198,7 +198,7 @@ out:
198static int ecryptfs_readpage(struct file *file, struct page *page) 198static int ecryptfs_readpage(struct file *file, struct page *page)
199{ 199{
200 struct ecryptfs_crypt_stat *crypt_stat = 200 struct ecryptfs_crypt_stat *crypt_stat =
201 &ecryptfs_inode_to_private(file->f_path.dentry->d_inode)->crypt_stat; 201 &ecryptfs_inode_to_private(page->mapping->host)->crypt_stat;
202 int rc = 0; 202 int rc = 0;
203 203
204 if (!crypt_stat 204 if (!crypt_stat
@@ -300,8 +300,7 @@ static int ecryptfs_write_begin(struct file *file,
300 300
301 if (!PageUptodate(page)) { 301 if (!PageUptodate(page)) {
302 struct ecryptfs_crypt_stat *crypt_stat = 302 struct ecryptfs_crypt_stat *crypt_stat =
303 &ecryptfs_inode_to_private( 303 &ecryptfs_inode_to_private(mapping->host)->crypt_stat;
304 file->f_path.dentry->d_inode)->crypt_stat;
305 304
306 if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED) 305 if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)
307 || (crypt_stat->flags & ECRYPTFS_NEW_FILE)) { 306 || (crypt_stat->flags & ECRYPTFS_NEW_FILE)) {
@@ -487,7 +486,7 @@ static int ecryptfs_write_end(struct file *file,
487 unsigned to = from + copied; 486 unsigned to = from + copied;
488 struct inode *ecryptfs_inode = mapping->host; 487 struct inode *ecryptfs_inode = mapping->host;
489 struct ecryptfs_crypt_stat *crypt_stat = 488 struct ecryptfs_crypt_stat *crypt_stat =
490 &ecryptfs_inode_to_private(file->f_path.dentry->d_inode)->crypt_stat; 489 &ecryptfs_inode_to_private(ecryptfs_inode)->crypt_stat;
491 int rc; 490 int rc;
492 491
493 if (crypt_stat->flags & ECRYPTFS_NEW_FILE) { 492 if (crypt_stat->flags & ECRYPTFS_NEW_FILE) {