diff options
author | Michael Halcrow <mhalcrow@us.ibm.com> | 2008-07-24 00:30:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:31 -0400 |
commit | 391b52f98cf2e9bff227dad8bf9ea206fec43fa4 (patch) | |
tree | 40eb4e0d6d399d9b98b791db497097a1ff44894e /fs/ecryptfs/file.c | |
parent | 72b55fffd631a89e5be6fe1b4f2565bc4cd90deb (diff) |
eCryptfs: Make all persistent file opens delayed
There is no good reason to immediately open the lower file, and that can
cause problems with files that the user does not intend to immediately
open, such as device nodes.
This patch removes the persistent file open from the interpose step and
pushes that to the locations where eCryptfs really does need the lower
persistent file, such as just before reading or writing the metadata
stored in the lower file header.
Two functions are jumping to out_dput when they should just be jumping to
out on error paths. This patch also fixes these.
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>
Diffstat (limited to 'fs/ecryptfs/file.c')
-rw-r--r-- | fs/ecryptfs/file.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index 2c2d60df3f60..9244d653743e 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
@@ -200,10 +200,6 @@ static int ecryptfs_open(struct inode *inode, struct file *file) | |||
200 | goto out; | 200 | goto out; |
201 | } | 201 | } |
202 | if (!ecryptfs_inode_to_private(inode)->lower_file) { | 202 | if (!ecryptfs_inode_to_private(inode)->lower_file) { |
203 | BUG_ON(!(crypt_stat->flags & ECRYPTFS_DELAY_PERSISTENT)); | ||
204 | mutex_lock(&crypt_stat->cs_mutex); | ||
205 | crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED); | ||
206 | mutex_unlock(&crypt_stat->cs_mutex); | ||
207 | rc = ecryptfs_init_persistent_file(ecryptfs_dentry); | 203 | rc = ecryptfs_init_persistent_file(ecryptfs_dentry); |
208 | if (rc) { | 204 | if (rc) { |
209 | printk(KERN_ERR "%s: Error attempting to initialize " | 205 | printk(KERN_ERR "%s: Error attempting to initialize " |