Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932577AbcDEBku (ORCPT ); Mon, 4 Apr 2016 21:40:50 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:58240 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932544AbcDEBkr (ORCPT ); Mon, 4 Apr 2016 21:40:47 -0400 From: "Eric W. Biederman" To: Linus Torvalds Cc: "H. Peter Anvin" , Peter Hurley , Greg KH , Jiri Slaby , Aurelien Jarno , Andy Lutomirski , Florian Weimer , Al Viro , Serge Hallyn , Jann Horn , "security@kernel.org" , security@ubuntu.com, security@debian.org, Willy Tarreau , Linux Kernel Mailing List , "Eric W. Biederman" Date: Mon, 4 Apr 2016 20:29:26 -0500 Message-Id: <1459819769-30387-10-git-send-email-ebiederm@xmission.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1459819769-30387-1-git-send-email-ebiederm@xmission.com> References: <878u0s3orx.fsf_-_@x220.int.ebiederm.org> <1459819769-30387-1-git-send-email-ebiederm@xmission.com> X-XM-AID: U2FsdGVkX1+sGmDvurnEI+hZJKt5ZnDeKnEJflDFEpc= X-SA-Exim-Connect-IP: 67.3.249.252 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.1 XMSolicitRefs_0 Weightloss drug X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Linus Torvalds X-Spam-Relay-Country: X-Spam-Timing: total 306 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 4.3 (1.4%), b_tie_ro: 3.1 (1.0%), parse: 0.98 (0.3%), extract_message_metadata: 15 (4.9%), get_uri_detail_list: 1.79 (0.6%), tests_pri_-1000: 6 (2.1%), tests_pri_-950: 1.21 (0.4%), tests_pri_-900: 1.02 (0.3%), tests_pri_-400: 20 (6.6%), check_bayes: 19 (6.3%), b_tokenize: 6 (2.0%), b_tok_get_all: 6 (1.9%), b_comp_prob: 1.62 (0.5%), b_tok_touch_all: 3.2 (1.1%), b_finish: 0.70 (0.2%), tests_pri_0: 250 (81.7%), check_dkim_signature: 0.48 (0.2%), check_dkim_adsp: 3.4 (1.1%), tests_pri_500: 4.1 (1.4%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 10/13] devpts: Simplify devpts_mount by using mount_nodev X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1666 Lines: 58 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" --- 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 5356a68863b8..7b4fe0d4018d 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -550,7 +550,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; @@ -563,30 +562,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.6.3