Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1379954

[PATCH 13/16] devpts: Simplify devpts_mount by using mount_nodev

From "Eric W. Biederman" <ebiederm@xmission.com>
Newsgroups linux.kernel
Subject [PATCH 13/16] devpts: Simplify devpts_mount by using mount_nodev
Date 2016-04-15 18:00 +0200
Message-ID <roek3-5nF-23@gated-at.bofh.it> (permalink)
References <roeal-5jh-5@gated-at.bofh.it> <roeal-5jh-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Now that all of the work of setting up a superblock has been moved to
devpts_fill_super simplify devpts_mount by calling mount_nodev instead
of rolling mount_nodev by hand.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 fs/devpts/inode.c | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 3aa223803a08..c1c346190f35 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -467,7 +467,6 @@ static int compare_init_pts_sb(struct super_block *s, void *p)
 static struct dentry *devpts_mount(struct file_system_type *fs_type,
 	int flags, const char *dev_name, void *data)
 {
-	int error;
 	struct super_block *s;
 	bool newinstance;
 
@@ -480,30 +479,16 @@ static struct dentry *devpts_mount(struct file_system_type *fs_type,
 		return ERR_PTR(-EINVAL);
 
 	if (newinstance)
-		s = sget(fs_type, NULL, set_anon_super, flags, NULL);
-	else
-		s = sget(fs_type, compare_init_pts_sb, set_anon_super, flags,
-			 NULL);
+		return mount_nodev(fs_type, flags, data, devpts_fill_super);
 
+	s = sget(fs_type, compare_init_pts_sb, set_anon_super, flags, NULL);
 	if (IS_ERR(s))
 		return ERR_CAST(s);
 
-	if (!s->s_root) {
-		error = devpts_fill_super(s, data, flags & MS_SILENT ? 1 : 0);
-		if (error)
-			goto out_undo_sget;
-
-		s->s_flags |= MS_ACTIVE;
-	} else {
-		/* Match mount_single ignore errors on remount */
-		devpts_remount(s, &flags, data);
-	}
+	/* Match mount_single ignore errors on remount */
+	devpts_remount(s, &flags, data);
 
 	return dget(s->s_root);
-
-out_undo_sget:
-	deactivate_locked_super(s);
-	return ERR_PTR(error);
 }
 
 #else
-- 
2.8.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/13] devpts: New instances for every mount ebiederm@xmission.com (Eric W. Biederman) - 2016-04-05 02:20 +0200
  [PATCH 04/13] devpts: Stop rolling devpts_remount by hand in devpts_mount "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 03:50 +0200
  [PATCH 05/13] devpts: Fail early (if appropriate) on overmount "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 03:50 +0200
  [PATCH 08/13] devpts: Make devpts_kill_sb safe if fsi is NULL "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 03:50 +0200
  [PATCH 03/13] devpts: Cleanup newinstance parsing "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 03:50 +0200
  [PATCH 06/13] devpts: Use the same default mode for both /dev/ptmx and dev/pts/ptmx "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 03:50 +0200
  [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 03:50 +0200
    [PATCH 09/13] devpts: Move the creation of /dev/pts/ptmx into fill_super "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 03:50 +0200
    [PATCH 02/13] devpts: More obvious check for the system devpts in pty allocation "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 03:50 +0200
    [PATCH 13/13] devpts: Kill the DEVPTS_MULTIPLE_INSTANCE config option "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 03:50 +0200
    [PATCH 07/13] devpts: Move parse_mount_options into fill_super "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 03:50 +0200
    [PATCH 12/13] devpts: Always return a distinct instance when mounting "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 04:00 +0200
    [PATCH 11/13] vfs: Implement mount_super_once "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 04:00 +0200
    [PATCH 10/13] devpts: Simplify devpts_mount by using mount_nodev "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-05 04:00 +0200
    Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Al Viro <viro@ZenIV.linux.org.uk> - 2016-04-05 05:00 +0200
      Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Al Viro <viro@ZenIV.linux.org.uk> - 2016-04-05 05:10 +0200
        Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-08 21:10 +0200
    Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-07 18:10 +0200
      Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-08 21:10 +0200
        Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-08 21:10 +0200
          Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-08 22:20 +0200
          Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Andy Lutomirski <luto@amacapital.net> - 2016-04-08 22:50 +0200
            Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-08 23:50 +0200
              Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Andy Lutomirski <luto@amacapital.net> - 2016-04-09 00:00 +0200
              Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-09 00:00 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-09 01:20 +0200
        Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-04-09 15:20 +0200
          Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup "H. Peter Anvin" <hpa@zytor.com> - 2016-04-09 16:20 +0200
            Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-09 17:00 +0200
              Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup "H. Peter Anvin" <hpa@zytor.com> - 2016-04-10 00:50 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-10 02:10 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup "H. Peter Anvin" <hpa@zytor.com> - 2016-04-10 02:20 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-10 02:20 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Andy Lutomirski <luto@amacapital.net> - 2016-04-10 02:50 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup "H. Peter Anvin" <hpa@zytor.com> - 2016-04-11 17:10 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Al Viro <viro@ZenIV.linux.org.uk> - 2016-04-12 03:40 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Andy Lutomirski <luto@amacapital.net> - 2016-04-11 22:20 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup "H. Peter Anvin" <hpa@zytor.com> - 2016-04-11 22:30 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-12 01:50 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-12 02:10 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-12 02:30 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-12 03:20 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup "H. Peter Anvin" <hpa@zytor.com> - 2016-04-12 03:20 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-12 03:40 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Al Viro <viro@ZenIV.linux.org.uk> - 2016-04-12 03:50 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Al Viro <viro@ZenIV.linux.org.uk> - 2016-04-12 03:40 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-12 04:30 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-11 22:30 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Andy Lutomirski <luto@amacapital.net> - 2016-04-12 19:50 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-12 20:20 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup "H. Peter Anvin" <hpa@zytor.com> - 2016-04-12 21:20 +0200
                [PATCH 01/16] devpts: Attempting to get it right ebiederm@xmission.com (Eric W. Biederman) - 2016-04-15 17:50 +0200
                [PATCH 08/16] devpts: Stop rolling devpts_remount by hand in devpts_mount "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 17:50 +0200
                [PATCH 05/16] vfs: Allow unlink, and rename on expirable file mounts "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 17:50 +0200
                [PATCH 04/16] devpts: Teach /dev/ptmx to automount the appropriate devpts via path lookup "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 17:50 +0200
                Re: [PATCH 04/16] devpts: Teach /dev/ptmx to automount the  appropriate devpts via path lookup Jann Horn <jann@thejh.net> - 2016-04-16 00:10 +0200
                Re: [PATCH 04/16] devpts: Teach /dev/ptmx to automount the appropriate devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-19 21:00 +0200
                [PATCH 09/16] devpts: Fail early (if appropriate) on overmount "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 17:50 +0200
                [PATCH 10/16] devpts: Move parse_mount_options into fill_super "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 17:50 +0200
                [PATCH 06/16] devpts: More obvious check for the system devpts in pty allocation "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 17:50 +0200
                [PATCH 01/16] devpts: Use the same default mode for both /dev/ptmx and dev/pts/ptmx "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 17:50 +0200
                [PATCH 12/16] devpts: Move the creation of /dev/pts/ptmx into fill_super "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 18:00 +0200
                [PATCH 11/16] devpts: Make devpts_kill_sb safe if fsi is NULL "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 18:00 +0200
                [PATCH 16/16] devpts: Kill the DEVPTS_MULTIPLE_INSTANCE config option "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 18:00 +0200
                [PATCH 15/16] devpts: Always return a distinct instance when mounting "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 18:00 +0200
                [PATCH 13/16] devpts: Simplify devpts_mount by using mount_nodev "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 18:00 +0200
                [PATCH 14/16] vfs: Implement mount_super_once "Eric W. Biederman" <ebiederm@xmission.com> - 2016-04-15 18:00 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-16 01:10 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once ebiederm@xmission.com (Eric W. Biederman) - 2016-04-19 20:40 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once "H. Peter Anvin" <hpa@zytor.com> - 2016-04-19 21:00 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once ebiederm@xmission.com (Eric W. Biederman) - 2016-04-19 21:20 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once "H. Peter Anvin" <hpa@zytor.com> - 2016-04-19 21:30 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once ebiederm@xmission.com (Eric W. Biederman) - 2016-04-20 05:40 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once "Austin S. Hemmelgarn" <ahferroin7@gmail.com> - 2016-04-20 14:00 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once "H. Peter Anvin" <hpa@zytor.com> - 2016-04-20 18:20 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once "H. Peter Anvin" <hpa@zytor.com> - 2016-04-19 21:30 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once "H. Peter Anvin" <hpa@zytor.com> - 2016-04-19 21:00 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-20 01:30 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-20 03:30 +0200
                Re: [PATCH 14/16] vfs: Implement mount_super_once "H. Peter Anvin" <hpa@zytor.com> - 2016-04-20 03:50 +0200
                Re: [PATCH 01/16] devpts: Attempting to get it right Andy Lutomirski <luto@amacapital.net> - 2016-04-15 18:50 +0200
                Re: [PATCH 01/16] devpts: Attempting to get it right ebiederm@xmission.com (Eric W. Biederman) - 2016-04-15 23:00 +0200
                Re: [PATCH 01/16] devpts: Attempting to get it right "H. Peter Anvin" <hpa@zytor.com> - 2016-04-15 23:40 +0200
                Re: [PATCH 01/16] devpts: Attempting to get it right ebiederm@xmission.com (Eric W. Biederman) - 2016-04-19 21:20 +0200
                Re: [PATCH 01/16] devpts: Attempting to get it right Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-16 20:40 +0200
                Does anyone care about a race free ptsname? ebiederm@xmission.com (Eric W. Biederman) - 2016-04-19 21:00 +0200
                Re: Does anyone care about a race free ptsname? "H. Peter Anvin" <hpa@zytor.com> - 2016-04-19 21:30 +0200
                Re: Does anyone care about a race free ptsname? ebiederm@xmission.com (Eric W. Biederman) - 2016-04-19 22:50 +0200
                Re: Does anyone care about a race free ptsname? "H. Peter Anvin" <hpa@zytor.com> - 2016-04-19 23:10 +0200
                Re: Does anyone care about a race free ptsname? "Serge E. Hallyn" <serge@hallyn.com> - 2016-04-19 22:50 +0200
                Re: Does anyone care about a race free ptsname? Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-20 01:30 +0200
                Re: Does anyone care about a race free ptsname? "H. Peter Anvin" <hpa@zytor.com> - 2016-04-20 01:50 +0200
                Re: Does anyone care about a race free ptsname? Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-20 02:20 +0200
                Re: Does anyone care about a race free ptsname? "Serge E. Hallyn" <serge@hallyn.com> - 2016-04-20 03:50 +0200
                Re: [PATCH 01/16] devpts: Attempting to get it right ebiederm@xmission.com (Eric W. Biederman) - 2016-04-20 00:20 +0200
                Re: [PATCH 01/16] devpts: Attempting to get it right Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-20 01:40 +0200
                Re: [PATCH 01/16] devpts: Attempting to get it right Peter Hurley <peter@hurleysoftware.com> - 2016-04-20 02:30 +0200
                Re: [PATCH 01/16] devpts: Attempting to get it right Peter Hurley <peter@hurleysoftware.com> - 2016-04-20 02:50 +0200
                [PATCH] devpts: Make each mount of devpts an independent filesystem. ebiederm@xmission.com (Eric W. Biederman) - 2016-04-20 05:20 +0200
                Re: [PATCH] devpts: Make each mount of devpts an independent  filesystem. Al Viro <viro@ZenIV.linux.org.uk> - 2016-04-20 05:30 +0200
                Re: [PATCH] devpts: Make each mount of devpts an independent filesystem. ebiederm@xmission.com (Eric W. Biederman) - 2016-04-20 06:00 +0200
                Re: [PATCH] devpts: Make each mount of devpts an independent  filesystem. Al Viro <viro@ZenIV.linux.org.uk> - 2016-04-20 06:20 +0200
                Re: [PATCH] devpts: Make each mount of devpts an independent filesystem. ebiederm@xmission.com (Eric W. Biederman) - 2016-04-20 06:40 +0200
                Re: [PATCH] devpts: Make each mount of devpts an independent filesystem. Konstantin Khlebnikov <koct9i@gmail.com> - 2016-04-20 06:40 +0200
                Re: [PATCH] devpts: Make each mount of devpts an independent filesystem. Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-20 07:00 +0200
                Re: [PATCH] devpts: Make each mount of devpts an independent filesystem. ebiederm@xmission.com (Eric W. Biederman) - 2016-04-20 17:10 +0200
                Re: [PATCH] devpts: Make each mount of devpts an independent filesystem. Konstantin Khlebnikov <koct9i@gmail.com> - 2016-04-20 17:40 +0200
                Re: [PATCH] devpts: Make each mount of devpts an independent filesystem. ebiederm@xmission.com (Eric W. Biederman) - 2016-04-20 18:10 +0200
                [PATCH v2] devpts: Make each mount of devpts an independent filesystem. ebiederm@xmission.com (Eric W. Biederman) - 2016-04-20 19:20 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-12 02:10 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-12 02:10 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-12 02:40 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated  devpts via path lookup Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-12 03:00 +0200
                Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup ebiederm@xmission.com (Eric W. Biederman) - 2016-04-11 22:20 +0200

csiph-web