]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ecryptfs/file.c
blackfin: use kbuild.h instead of defining macros in asm-macros.c
[linux-2.6-omap-h63xx.git] / fs / ecryptfs / file.c
index c98c4690a771c78ad69d3188be2a595be081fa66..2258b8f654a62ff7f45e6df55cd3a501d1c5dc25 100644 (file)
@@ -195,7 +195,9 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
                file, ecryptfs_inode_to_private(inode)->lower_file);
        if (S_ISDIR(ecryptfs_dentry->d_inode->i_mode)) {
                ecryptfs_printk(KERN_DEBUG, "This is a directory\n");
+               mutex_lock(&crypt_stat->cs_mutex);
                crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED);
+               mutex_unlock(&crypt_stat->cs_mutex);
                rc = 0;
                goto out;
        }
@@ -209,9 +211,10 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
                        if (!(mount_crypt_stat->flags
                              & ECRYPTFS_PLAINTEXT_PASSTHROUGH_ENABLED)) {
                                rc = -EIO;
-                               printk(KERN_WARNING "Attempt to read file that "
+                               printk(KERN_WARNING "Either the lower file "
                                       "is not in a valid eCryptfs format, "
-                                      "and plaintext passthrough mode is not "
+                                      "or the key could not be retrieved. "
+                                      "Plaintext passthrough mode is not "
                                       "enabled; returning -EIO\n");
                                mutex_unlock(&crypt_stat->cs_mutex);
                                goto out_free;