diff options
Diffstat (limited to 'fs/ecryptfs/main.c')
-rw-r--r-- | fs/ecryptfs/main.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index d4f00bbbcdc5..00686f1c5997 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
@@ -188,10 +188,11 @@ static int ecryptfs_init_global_auth_toks( | |||
188 | list_for_each_entry(global_auth_tok, | 188 | list_for_each_entry(global_auth_tok, |
189 | &mount_crypt_stat->global_auth_tok_list, | 189 | &mount_crypt_stat->global_auth_tok_list, |
190 | mount_crypt_stat_list) { | 190 | mount_crypt_stat_list) { |
191 | if ((rc = ecryptfs_keyring_auth_tok_for_sig( | 191 | rc = ecryptfs_keyring_auth_tok_for_sig( |
192 | &global_auth_tok->global_auth_tok_key, | 192 | &global_auth_tok->global_auth_tok_key, |
193 | &global_auth_tok->global_auth_tok, | 193 | &global_auth_tok->global_auth_tok, |
194 | global_auth_tok->sig))) { | 194 | global_auth_tok->sig); |
195 | if (rc) { | ||
195 | printk(KERN_ERR "Could not find valid key in user " | 196 | printk(KERN_ERR "Could not find valid key in user " |
196 | "session keyring for sig specified in mount " | 197 | "session keyring for sig specified in mount " |
197 | "option: [%s]\n", global_auth_tok->sig); | 198 | "option: [%s]\n", global_auth_tok->sig); |
@@ -355,9 +356,10 @@ static int ecryptfs_parse_options(struct super_block *sb, char *options) | |||
355 | if (!cipher_key_bytes_set) { | 356 | if (!cipher_key_bytes_set) { |
356 | mount_crypt_stat->global_default_cipher_key_size = 0; | 357 | mount_crypt_stat->global_default_cipher_key_size = 0; |
357 | } | 358 | } |
358 | if ((rc = ecryptfs_add_new_key_tfm( | 359 | rc = ecryptfs_add_new_key_tfm( |
359 | NULL, mount_crypt_stat->global_default_cipher_name, | 360 | NULL, mount_crypt_stat->global_default_cipher_name, |
360 | mount_crypt_stat->global_default_cipher_key_size))) { | 361 | mount_crypt_stat->global_default_cipher_key_size); |
362 | if (rc) { | ||
361 | printk(KERN_ERR "Error attempting to initialize cipher with " | 363 | printk(KERN_ERR "Error attempting to initialize cipher with " |
362 | "name = [%s] and key size = [%td]; rc = [%d]\n", | 364 | "name = [%s] and key size = [%td]; rc = [%d]\n", |
363 | mount_crypt_stat->global_default_cipher_name, | 365 | mount_crypt_stat->global_default_cipher_name, |
@@ -365,7 +367,8 @@ static int ecryptfs_parse_options(struct super_block *sb, char *options) | |||
365 | rc = -EINVAL; | 367 | rc = -EINVAL; |
366 | goto out; | 368 | goto out; |
367 | } | 369 | } |
368 | if ((rc = ecryptfs_init_global_auth_toks(mount_crypt_stat))) { | 370 | rc = ecryptfs_init_global_auth_toks(mount_crypt_stat); |
371 | if (rc) { | ||
369 | printk(KERN_WARNING "One or more global auth toks could not " | 372 | printk(KERN_WARNING "One or more global auth toks could not " |
370 | "properly register; rc = [%d]\n", rc); | 373 | "properly register; rc = [%d]\n", rc); |
371 | } | 374 | } |
@@ -458,7 +461,8 @@ static int ecryptfs_read_super(struct super_block *sb, const char *dev_name) | |||
458 | sb->s_maxbytes = lower_root->d_sb->s_maxbytes; | 461 | sb->s_maxbytes = lower_root->d_sb->s_maxbytes; |
459 | ecryptfs_set_dentry_lower(sb->s_root, lower_root); | 462 | ecryptfs_set_dentry_lower(sb->s_root, lower_root); |
460 | ecryptfs_set_dentry_lower_mnt(sb->s_root, lower_mnt); | 463 | ecryptfs_set_dentry_lower_mnt(sb->s_root, lower_mnt); |
461 | if ((rc = ecryptfs_interpose(lower_root, sb->s_root, sb, 0))) | 464 | rc = ecryptfs_interpose(lower_root, sb->s_root, sb, 0); |
465 | if (rc) | ||
462 | goto out_free; | 466 | goto out_free; |
463 | rc = 0; | 467 | rc = 0; |
464 | goto out; | 468 | goto out; |
@@ -765,7 +769,8 @@ static int do_sysfs_registration(void) | |||
765 | { | 769 | { |
766 | int rc; | 770 | int rc; |
767 | 771 | ||
768 | if ((rc = subsystem_register(&ecryptfs_subsys))) { | 772 | rc = subsystem_register(&ecryptfs_subsys); |
773 | if (rc) { | ||
769 | printk(KERN_ERR | 774 | printk(KERN_ERR |
770 | "Unable to register ecryptfs sysfs subsystem\n"); | 775 | "Unable to register ecryptfs sysfs subsystem\n"); |
771 | goto out; | 776 | goto out; |
@@ -796,7 +801,8 @@ static void do_sysfs_unregistration(void) | |||
796 | { | 801 | { |
797 | int rc; | 802 | int rc; |
798 | 803 | ||
799 | if ((rc = ecryptfs_destroy_crypto())) { | 804 | rc = ecryptfs_destroy_crypto(); |
805 | if (rc) { | ||
800 | printk(KERN_ERR "Failure whilst attempting to destroy crypto; " | 806 | printk(KERN_ERR "Failure whilst attempting to destroy crypto; " |
801 | "rc = [%d]\n", rc); | 807 | "rc = [%d]\n", rc); |
802 | } | 808 | } |