aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ecryptfs/main.c')
-rw-r--r--fs/ecryptfs/main.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 046e027a4cb1..64d2ba980df4 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -471,31 +471,26 @@ out:
471 */ 471 */
472static int ecryptfs_read_super(struct super_block *sb, const char *dev_name) 472static int ecryptfs_read_super(struct super_block *sb, const char *dev_name)
473{ 473{
474 struct path path;
474 int rc; 475 int rc;
475 struct nameidata nd;
476 struct dentry *lower_root;
477 struct vfsmount *lower_mnt;
478 476
479 memset(&nd, 0, sizeof(struct nameidata)); 477 rc = kern_path(dev_name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path);
480 rc = path_lookup(dev_name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &nd);
481 if (rc) { 478 if (rc) {
482 ecryptfs_printk(KERN_WARNING, "path_lookup() failed\n"); 479 ecryptfs_printk(KERN_WARNING, "path_lookup() failed\n");
483 goto out; 480 goto out;
484 } 481 }
485 lower_root = nd.path.dentry; 482 ecryptfs_set_superblock_lower(sb, path.dentry->d_sb);
486 lower_mnt = nd.path.mnt; 483 sb->s_maxbytes = path.dentry->d_sb->s_maxbytes;
487 ecryptfs_set_superblock_lower(sb, lower_root->d_sb); 484 sb->s_blocksize = path.dentry->d_sb->s_blocksize;
488 sb->s_maxbytes = lower_root->d_sb->s_maxbytes; 485 ecryptfs_set_dentry_lower(sb->s_root, path.dentry);
489 sb->s_blocksize = lower_root->d_sb->s_blocksize; 486 ecryptfs_set_dentry_lower_mnt(sb->s_root, path.mnt);
490 ecryptfs_set_dentry_lower(sb->s_root, lower_root); 487 rc = ecryptfs_interpose(path.dentry, sb->s_root, sb, 0);
491 ecryptfs_set_dentry_lower_mnt(sb->s_root, lower_mnt);
492 rc = ecryptfs_interpose(lower_root, sb->s_root, sb, 0);
493 if (rc) 488 if (rc)
494 goto out_free; 489 goto out_free;
495 rc = 0; 490 rc = 0;
496 goto out; 491 goto out;
497out_free: 492out_free:
498 path_put(&nd.path); 493 path_put(&path);
499out: 494out:
500 return rc; 495 return rc;
501} 496}