diff options
Diffstat (limited to 'fs/devpts/inode.c')
-rw-r--r-- | fs/devpts/inode.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 70013dd8ec70..58b719006af1 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c | |||
@@ -338,17 +338,7 @@ static int new_pts_mount(struct file_system_type *fs_type, int flags, | |||
338 | fsi = DEVPTS_SB(mnt->mnt_sb); | 338 | fsi = DEVPTS_SB(mnt->mnt_sb); |
339 | memcpy(&fsi->mount_opts, opts, sizeof(opts)); | 339 | memcpy(&fsi->mount_opts, opts, sizeof(opts)); |
340 | 340 | ||
341 | err = mknod_ptmx(mnt->mnt_sb); | ||
342 | if (err) | ||
343 | goto fail; | ||
344 | |||
345 | return 0; | 341 | return 0; |
346 | |||
347 | fail: | ||
348 | dput(mnt->mnt_sb->s_root); | ||
349 | up_write(&mnt->mnt_sb->s_umount); | ||
350 | deactivate_super(mnt->mnt_sb); | ||
351 | return err; | ||
352 | } | 342 | } |
353 | 343 | ||
354 | /* | 344 | /* |
@@ -416,13 +406,6 @@ static int init_pts_mount(struct file_system_type *fs_type, int flags, | |||
416 | if (err) | 406 | if (err) |
417 | return err; | 407 | return err; |
418 | 408 | ||
419 | err = mknod_ptmx(mnt->mnt_sb); | ||
420 | if (err) { | ||
421 | dput(mnt->mnt_sb->s_root); | ||
422 | up_write(&mnt->mnt_sb->s_umount); | ||
423 | deactivate_super(mnt->mnt_sb); | ||
424 | } | ||
425 | |||
426 | return err; | 409 | return err; |
427 | } | 410 | } |
428 | 411 | ||
@@ -440,9 +423,24 @@ static int devpts_get_sb(struct file_system_type *fs_type, | |||
440 | } | 423 | } |
441 | 424 | ||
442 | if (opts.newinstance) | 425 | if (opts.newinstance) |
443 | return new_pts_mount(fs_type, flags, data, &opts, mnt); | 426 | error = new_pts_mount(fs_type, flags, data, &opts, mnt); |
444 | else | 427 | else |
445 | return init_pts_mount(fs_type, flags, data, &opts, mnt); | 428 | error = init_pts_mount(fs_type, flags, data, &opts, mnt); |
429 | |||
430 | if (error) | ||
431 | return error; | ||
432 | |||
433 | error = mknod_ptmx(mnt->mnt_sb); | ||
434 | if (error) | ||
435 | goto out_dput; | ||
436 | |||
437 | return 0; | ||
438 | |||
439 | out_dput: | ||
440 | dput(mnt->mnt_sb->s_root); | ||
441 | up_write(&mnt->mnt_sb->s_umount); | ||
442 | deactivate_super(mnt->mnt_sb); | ||
443 | return error; | ||
446 | } | 444 | } |
447 | 445 | ||
448 | #else | 446 | #else |