lkml.org 
[lkml]   [2012]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] eCryptfs: Remove unreached codes
Date
The code segment handles the ECRYPTFS_VIEW_AS_ENCRYPTED option in
ecryptfs_write_begin(mmap.c) is unreached, since this option is
enabled only when eCryptfs is mounted with RDONLY.

Signed-off-by: Li Wang <liwang@nudt.edu.cn>
---
fs/ecryptfs/mmap.c | 29 +----------------------------
1 files changed, 1 insertions(+), 28 deletions(-)

diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index 59a8e57..a4802a6 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -320,35 +320,8 @@ static int ecryptfs_write_begin(struct file *file,
goto out;
} else
SetPageUptodate(page);
- } else if (crypt_stat->flags & ECRYPTFS_VIEW_AS_ENCRYPTED) {
- if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) {
- rc = ecryptfs_copy_up_encrypted_with_header(
- page, crypt_stat);
- if (rc) {
- printk(KERN_ERR "%s: Error attempting "
- "to copy the encrypted content "
- "from the lower file whilst "
- "inserting the metadata from "
- "the xattr into the header; rc "
- "= [%d]\n", __func__, rc);
- ClearPageUptodate(page);
- goto out;
- }
- SetPageUptodate(page);
- } else {
- rc = ecryptfs_read_lower_page_segment(
- page, index, 0, PAGE_CACHE_SIZE,
- mapping->host);
- if (rc) {
- printk(KERN_ERR "%s: Error reading "
- "page; rc = [%d]\n",
- __func__, rc);
- ClearPageUptodate(page);
- goto out;
- }
- SetPageUptodate(page);
- }
} else {
+ BUG_ON(crypt_stat->flags & ECRYPTFS_VIEW_AS_ENCRYPTED);
if (prev_page_end_size
>= i_size_read(page->mapping->host)) {
zero_user(page, 0, PAGE_CACHE_SIZE);
--
1.7.6.5


\
 
 \ /
  Last update: 2012-02-16 09:45    [W:0.043 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site