summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2016-04-19 17:51:04 -0500
committerEric W. Biederman <ebiederm@xmission.com>2016-09-22 13:32:08 -0500
commit7dd17f713474504fa6d61d666e27b02e4a608abe (patch)
tree62250104e725f5374f8f427b7d75b144c2aad0d8 /fs
parent208904793abad8892422edad0e712f2d939c496b (diff)
downloadop-kernel-dev-7dd17f713474504fa6d61d666e27b02e4a608abe.zip
op-kernel-dev-7dd17f713474504fa6d61d666e27b02e4a608abe.tar.gz
devpts: Move the creation of /dev/pts/ptmx into fill_super
The code makes more sense here and things are just clearer. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/devpts/inode.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index f582a4b..f3277f7 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -425,11 +425,19 @@ devpts_fill_super(struct super_block *s, void *data, int silent)
set_nlink(inode, 2);
s->s_root = d_make_root(inode);
- if (s->s_root)
- return 0;
+ if (!s->s_root) {
+ pr_err("get root dentry failed\n");
+ goto fail;
+ }
- pr_err("get root dentry failed\n");
+ error = mknod_ptmx(s);
+ if (error)
+ goto fail_dput;
+ return 0;
+fail_dput:
+ dput(s->s_root);
+ s->s_root = NULL;
fail:
return error;
}
@@ -456,11 +464,6 @@ static struct dentry *devpts_mount(struct file_system_type *fs_type,
goto out_undo_sget;
s->s_flags |= MS_ACTIVE;
}
-
- error = mknod_ptmx(s);
- if (error)
- goto out_undo_sget;
-
return dget(s->s_root);
out_undo_sget:
OpenPOWER on IntegriCloud