mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-02 20:29:20 +00:00
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>
This commit is contained in:
parent
72b55fffd6
commit
391b52f98c
4 changed files with 23 additions and 26 deletions
|
@ -201,22 +201,6 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
|
|||
/* This size will be overwritten for real files w/ headers and
|
||||
* other metadata */
|
||||
fsstack_copy_inode_size(inode, lower_inode);
|
||||
if (!(flags & ECRYPTFS_INTERPOSE_FLAG_DELAY_PERSISTENT_FILE)) {
|
||||
rc = ecryptfs_init_persistent_file(dentry);
|
||||
if (rc) {
|
||||
printk(KERN_ERR "%s: Error attempting to initialize "
|
||||
"the persistent file for the dentry with name "
|
||||
"[%s]; rc = [%d]\n", __func__,
|
||||
dentry->d_name.name, rc);
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
struct ecryptfs_inode_info *inode_info =
|
||||
ecryptfs_inode_to_private(dentry->d_inode);
|
||||
|
||||
inode_info->lower_file = NULL;
|
||||
inode_info->crypt_stat.flags |= ECRYPTFS_DELAY_PERSISTENT;
|
||||
}
|
||||
out:
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue