Skip to content

Commit

Permalink
devpts: Move the creation of /dev/pts/ptmx into fill_super
Browse files Browse the repository at this point in the history
The code makes more sense here and things are just clearer.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
  • Loading branch information
ebiederm committed Sep 22, 2016
1 parent 2089047 commit 7dd17f7
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions fs/devpts/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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:
Expand Down

0 comments on commit 7dd17f7

Please sign in to comment.