diff options
Diffstat (limited to 'fs/ecryptfs/main.c')
-rw-r--r-- | fs/ecryptfs/main.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 9ed476906327..758323a0f09a 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/parser.h> | 36 | #include <linux/parser.h> |
37 | #include <linux/fs_stack.h> | 37 | #include <linux/fs_stack.h> |
38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
39 | #include <linux/magic.h> | ||
39 | #include "ecryptfs_kernel.h" | 40 | #include "ecryptfs_kernel.h" |
40 | 41 | ||
41 | /** | 42 | /** |
@@ -141,13 +142,12 @@ int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry) | |||
141 | return rc; | 142 | return rc; |
142 | } | 143 | } |
143 | 144 | ||
144 | static inode *ecryptfs_get_inode(struct inode *lower_inode, | 145 | static struct inode *ecryptfs_get_inode(struct inode *lower_inode, |
145 | struct super_block *sb) | 146 | struct super_block *sb) |
146 | { | 147 | { |
147 | struct inode *inode; | 148 | struct inode *inode; |
148 | int rc = 0; | 149 | int rc = 0; |
149 | 150 | ||
150 | lower_inode = lower_dentry->d_inode; | ||
151 | if (lower_inode->i_sb != ecryptfs_superblock_to_lower(sb)) { | 151 | if (lower_inode->i_sb != ecryptfs_superblock_to_lower(sb)) { |
152 | rc = -EXDEV; | 152 | rc = -EXDEV; |
153 | goto out; | 153 | goto out; |
@@ -202,7 +202,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry, | |||
202 | { | 202 | { |
203 | struct inode *lower_inode = lower_dentry->d_inode; | 203 | struct inode *lower_inode = lower_dentry->d_inode; |
204 | struct inode *inode = ecryptfs_get_inode(lower_inode, sb); | 204 | struct inode *inode = ecryptfs_get_inode(lower_inode, sb); |
205 | if (IS_ERR(inode) | 205 | if (IS_ERR(inode)) |
206 | return PTR_ERR(inode); | 206 | return PTR_ERR(inode); |
207 | if (flags & ECRYPTFS_INTERPOSE_FLAG_D_ADD) | 207 | if (flags & ECRYPTFS_INTERPOSE_FLAG_D_ADD) |
208 | d_add(dentry, inode); | 208 | d_add(dentry, inode); |
@@ -565,6 +565,7 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags | |||
565 | ecryptfs_set_superblock_lower(s, path.dentry->d_sb); | 565 | ecryptfs_set_superblock_lower(s, path.dentry->d_sb); |
566 | s->s_maxbytes = path.dentry->d_sb->s_maxbytes; | 566 | s->s_maxbytes = path.dentry->d_sb->s_maxbytes; |
567 | s->s_blocksize = path.dentry->d_sb->s_blocksize; | 567 | s->s_blocksize = path.dentry->d_sb->s_blocksize; |
568 | s->s_magic = ECRYPTFS_SUPER_MAGIC; | ||
568 | 569 | ||
569 | inode = ecryptfs_get_inode(path.dentry->d_inode, s); | 570 | inode = ecryptfs_get_inode(path.dentry->d_inode, s); |
570 | rc = PTR_ERR(inode); | 571 | rc = PTR_ERR(inode); |
@@ -809,9 +810,10 @@ static int __init ecryptfs_init(void) | |||
809 | ecryptfs_printk(KERN_ERR, "The eCryptfs extent size is " | 810 | ecryptfs_printk(KERN_ERR, "The eCryptfs extent size is " |
810 | "larger than the host's page size, and so " | 811 | "larger than the host's page size, and so " |
811 | "eCryptfs cannot run on this system. The " | 812 | "eCryptfs cannot run on this system. The " |
812 | "default eCryptfs extent size is [%d] bytes; " | 813 | "default eCryptfs extent size is [%u] bytes; " |
813 | "the page size is [%d] bytes.\n", | 814 | "the page size is [%lu] bytes.\n", |
814 | ECRYPTFS_DEFAULT_EXTENT_SIZE, PAGE_CACHE_SIZE); | 815 | ECRYPTFS_DEFAULT_EXTENT_SIZE, |
816 | (unsigned long)PAGE_CACHE_SIZE); | ||
815 | goto out; | 817 | goto out; |
816 | } | 818 | } |
817 | rc = ecryptfs_init_kmem_caches(); | 819 | rc = ecryptfs_init_kmem_caches(); |