aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/inode.c
diff options
context:
space:
mode:
authorMichael Halcrow <mhalcrow@us.ibm.com>2008-07-24 00:30:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 13:47:31 -0400
commit72b55fffd631a89e5be6fe1b4f2565bc4cd90deb (patch)
treeece810c24655a6eeed96a6f2fbe14dea6478f031 /fs/ecryptfs/inode.c
parent0a688ad713949643e201431d3f4a4ceddfeb70ca (diff)
eCryptfs: do not try to open device files on mknod
When creating device nodes, eCryptfs needs to delay actually opening the lower persistent file until an application tries to open. Device handles may not be backed by anything when they first come into existence. [Valdis.Kletnieks@vt.edu: build fix] Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com> Cc: <Valdis.Kletnieks@vt.edu} Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs/inode.c')
-rw-r--r--fs/ecryptfs/inode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 7315547193ea..26090878c930 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -308,7 +308,8 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry,
308 d_add(dentry, NULL); 308 d_add(dentry, NULL);
309 goto out; 309 goto out;
310 } 310 }
311 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb, 1); 311 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb,
312 ECRYPTFS_INTERPOSE_FLAG_D_ADD);
312 if (rc) { 313 if (rc) {
313 ecryptfs_printk(KERN_ERR, "Error interposing\n"); 314 ecryptfs_printk(KERN_ERR, "Error interposing\n");
314 goto out_dput; 315 goto out_dput;
@@ -537,7 +538,8 @@ ecryptfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
537 rc = vfs_mknod(lower_dir_dentry->d_inode, lower_dentry, mode, dev); 538 rc = vfs_mknod(lower_dir_dentry->d_inode, lower_dentry, mode, dev);
538 if (rc || !lower_dentry->d_inode) 539 if (rc || !lower_dentry->d_inode)
539 goto out; 540 goto out;
540 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb, 0); 541 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb,
542 ECRYPTFS_INTERPOSE_FLAG_DELAY_PERSISTENT_FILE);
541 if (rc) 543 if (rc)
542 goto out; 544 goto out;
543 fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode); 545 fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode);