]> err.no Git - linux-2.6/blobdiff - fs/ecryptfs/file.c
Blackfin RTC Driver: do all initialization before we register the rtc and make it...
[linux-2.6] / fs / ecryptfs / file.c
index f0be29051528024d375057cfb6f39fc43568878b..9244d653743ec02c6d279071095f76c08c834dd6 100644 (file)
@@ -199,6 +199,16 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
                       "file must hence be opened RO\n", __func__);
                goto out;
        }
+       if (!ecryptfs_inode_to_private(inode)->lower_file) {
+               rc = ecryptfs_init_persistent_file(ecryptfs_dentry);
+               if (rc) {
+                       printk(KERN_ERR "%s: Error attempting to initialize "
+                              "the persistent file for the dentry with name "
+                              "[%s]; rc = [%d]\n", __func__,
+                              ecryptfs_dentry->d_name.name, rc);
+                       goto out;
+               }
+       }
        ecryptfs_set_file_lower(
                file, ecryptfs_inode_to_private(inode)->lower_file);
        if (S_ISDIR(ecryptfs_dentry->d_inode->i_mode)) {