Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752362AbcDOPrL (ORCPT ); Fri, 15 Apr 2016 11:47:11 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:50233 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752294AbcDOPrJ (ORCPT ); Fri, 15 Apr 2016 11:47:09 -0400 From: "Eric W. Biederman" To: Linus Torvalds Cc: "H. Peter Anvin" , Andy Lutomirski , security@debian.org, security@kernel.org, Al Viro , security@ubuntu.com, Peter Hurley , Serge Hallyn , Willy Tarreau , Aurelien Jarno , One Thousand Gnomes , Jann Horn , Greg KH , Linux Kernel Mailing List , Jiri Slaby , Florian Weimer , "Eric W. Biederman" Date: Fri, 15 Apr 2016 10:35:26 -0500 Message-Id: <1460734532-20134-10-git-send-email-ebiederm@xmission.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1460734532-20134-1-git-send-email-ebiederm@xmission.com> References: <877ffyzy1j.fsf_-_@x220.int.ebiederm.org> <1460734532-20134-1-git-send-email-ebiederm@xmission.com> X-XM-AID: U2FsdGVkX1/gIWxyYOzIADodtgEVPARMLvwP+AOf0Wc= 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.0 TVD_RCVD_IP Message was received from an IP address * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa04 1397; Body=1 Fuz1=1 Fuz2=25] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa04 1397; Body=1 Fuz1=1 Fuz2=25 X-Spam-Combo: **;Linus Torvalds X-Spam-Relay-Country: X-Spam-Timing: total 979 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 5 (0.5%), b_tie_ro: 3.5 (0.4%), parse: 1.24 (0.1%), extract_message_metadata: 13 (1.3%), get_uri_detail_list: 1.47 (0.2%), tests_pri_-1000: 6 (0.6%), tests_pri_-950: 1.09 (0.1%), tests_pri_-900: 0.94 (0.1%), tests_pri_-400: 20 (2.0%), check_bayes: 19 (1.9%), b_tokenize: 6 (0.6%), b_tok_get_all: 6 (0.6%), b_comp_prob: 1.52 (0.2%), b_tok_touch_all: 3.3 (0.3%), b_finish: 0.68 (0.1%), tests_pri_0: 921 (94.1%), check_dkim_signature: 0.45 (0.0%), check_dkim_adsp: 22 (2.3%), tests_pri_500: 7 (0.7%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 10/16] devpts: Move parse_mount_options into fill_super 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 in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1395 Lines: 56 Signed-off-by: "Eric W. Biederman" --- fs/devpts/inode.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 051a2657be36..2f2760142ed2 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -379,6 +379,7 @@ static int devpts_fill_super(struct super_block *s, void *data, int silent) { struct inode *inode; + int error; s->s_blocksize = 1024; s->s_blocksize_bits = 10; @@ -386,10 +387,16 @@ devpts_fill_super(struct super_block *s, void *data, int silent) s->s_op = &devpts_sops; s->s_time_gran = 1; + error = -ENOMEM; s->s_fs_info = new_pts_fs_info(); if (!s->s_fs_info) goto fail; + error = parse_mount_options(data, &DEVPTS_SB(s)->mount_opts); + if (error) + goto fail; + + error = -ENOMEM; inode = new_inode(s); if (!inode) goto fail; @@ -407,7 +414,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent) pr_err("get root dentry failed\n"); fail: - return -ENOMEM; + return error; } #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES @@ -474,10 +481,6 @@ static struct dentry *devpts_mount(struct file_system_type *fs_type, if (error) goto out_undo_sget; - error = parse_mount_options(data, &DEVPTS_SB(s)->mount_opts); - if (error) - goto out_undo_sget; - error = mknod_ptmx(s); if (error) goto out_undo_sget; -- 2.8.1