aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/main.c
diff options
context:
space:
mode:
authorMichael Halcrow <mhalcrow@us.ibm.com>2008-07-24 00:30:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 13:47:31 -0400
commit391b52f98cf2e9bff227dad8bf9ea206fec43fa4 (patch)
tree40eb4e0d6d399d9b98b791db497097a1ff44894e /fs/ecryptfs/main.c
parent72b55fffd631a89e5be6fe1b4f2565bc4cd90deb (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/main.c')
-rw-r--r--fs/ecryptfs/main.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index ee4f84b20410..6f403cfba14f 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -201,22 +201,6 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
201 /* This size will be overwritten for real files w/ headers and 201 /* This size will be overwritten for real files w/ headers and
202 * other metadata */ 202 * other metadata */
203 fsstack_copy_inode_size(inode, lower_inode); 203 fsstack_copy_inode_size(inode, lower_inode);
204 if (!(flags & ECRYPTFS_INTERPOSE_FLAG_DELAY_PERSISTENT_FILE)) {
205 rc = ecryptfs_init_persistent_file(dentry);
206 if (rc) {
207 printk(KERN_ERR "%s: Error attempting to initialize "
208 "the persistent file for the dentry with name "
209 "[%s]; rc = [%d]\n", __func__,
210 dentry->d_name.name, rc);
211 goto out;
212 }
213 } else {
214 struct ecryptfs_inode_info *inode_info =
215 ecryptfs_inode_to_private(dentry->d_inode);
216
217 inode_info->lower_file = NULL;
218 inode_info->crypt_stat.flags |= ECRYPTFS_DELAY_PERSISTENT;
219 }
220out: 204out:
221 return rc; 205 return rc;
222} 206}