diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-08-14 06:19:59 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-08-14 06:19:59 -0400 |
| commit | 8d7ccaa545490cdffdfaff0842436a8dd85cf47b (patch) | |
| tree | 8129b5907161bc6ae26deb3645ce1e280c5e1f51 /fs/ecryptfs/file.c | |
| parent | b2139aa0eec330c711c5a279db361e5ef1178e78 (diff) | |
| parent | 30a2f3c60a84092c8084dfe788b710f8d0768cd4 (diff) | |
Merge commit 'v2.6.27-rc3' into x86/prototypes
Conflicts:
include/asm-x86/dma-mapping.h
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/ecryptfs/file.c')
| -rw-r--r-- | fs/ecryptfs/file.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index 24749bf0668f..9244d653743e 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
| @@ -192,6 +192,23 @@ static int ecryptfs_open(struct inode *inode, struct file *file) | |||
| 192 | | ECRYPTFS_ENCRYPTED); | 192 | | ECRYPTFS_ENCRYPTED); |
| 193 | } | 193 | } |
| 194 | mutex_unlock(&crypt_stat->cs_mutex); | 194 | mutex_unlock(&crypt_stat->cs_mutex); |
| 195 | if ((ecryptfs_inode_to_private(inode)->lower_file->f_flags & O_RDONLY) | ||
| 196 | && !(file->f_flags & O_RDONLY)) { | ||
| 197 | rc = -EPERM; | ||
| 198 | printk(KERN_WARNING "%s: Lower persistent file is RO; eCryptfs " | ||
| 199 | "file must hence be opened RO\n", __func__); | ||
| 200 | goto out; | ||
| 201 | } | ||
| 202 | if (!ecryptfs_inode_to_private(inode)->lower_file) { | ||
| 203 | rc = ecryptfs_init_persistent_file(ecryptfs_dentry); | ||
| 204 | if (rc) { | ||
| 205 | printk(KERN_ERR "%s: Error attempting to initialize " | ||
| 206 | "the persistent file for the dentry with name " | ||
| 207 | "[%s]; rc = [%d]\n", __func__, | ||
| 208 | ecryptfs_dentry->d_name.name, rc); | ||
| 209 | goto out; | ||
| 210 | } | ||
| 211 | } | ||
| 195 | ecryptfs_set_file_lower( | 212 | ecryptfs_set_file_lower( |
| 196 | file, ecryptfs_inode_to_private(inode)->lower_file); | 213 | file, ecryptfs_inode_to_private(inode)->lower_file); |
| 197 | if (S_ISDIR(ecryptfs_dentry->d_inode->i_mode)) { | 214 | if (S_ISDIR(ecryptfs_dentry->d_inode->i_mode)) { |
