From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764181AbcINTHk (ORCPT ); Wed, 14 Sep 2016 15:07:40 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:53152 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757554AbcINTHg (ORCPT ); Wed, 14 Sep 2016 15:07:36 -0400 From: "Eric W. Biederman" To: Greg Kroah-Hartman , Jiri Slaby Cc: "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Linux Containers , "Eric W. Biederman" Date: Wed, 14 Sep 2016 13:53:33 -0500 Message-Id: <20160914185338.15126-1-ebiederm@xmission.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <87sht25n73.fsf@x220.int.ebiederm.org> References: <87sht25n73.fsf@x220.int.ebiederm.org> X-XM-SPF: eid=1bkFWw-0000r5-F9;;;mid=<20160914185338.15126-1-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.97.64;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+dwjCYwD5iCcDP8t2+hWggv2/6E7ZyKQo= X-SA-Exim-Connect-IP: 97.119.97.64 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.3 TooManyTo_001 Multiple "To" Header Recipients 2x (uncommon) * 0.7 XMSubLong Long Subject * 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 * [sa02 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa02 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Greg Kroah-Hartman , Jiri Slaby X-Spam-Relay-Country: X-Spam-Timing: total 575 ms - load_scoreonly_sql: 0.15 (0.0%), signal_user_changed: 4.5 (0.8%), b_tie_ro: 2.8 (0.5%), parse: 1.53 (0.3%), extract_message_metadata: 26 (4.6%), get_uri_detail_list: 2.3 (0.4%), tests_pri_-1000: 11 (1.9%), tests_pri_-950: 2.2 (0.4%), tests_pri_-900: 1.78 (0.3%), tests_pri_-400: 30 (5.2%), check_bayes: 28 (4.8%), b_tokenize: 10 (1.7%), b_tok_get_all: 9 (1.5%), b_comp_prob: 2.9 (0.5%), b_tok_touch_all: 2.7 (0.5%), b_finish: 0.98 (0.2%), tests_pri_0: 452 (78.5%), check_dkim_signature: 1.22 (0.2%), check_dkim_adsp: 6 (1.0%), tests_pri_500: 40 (7.0%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH tty-next 1/6] devpts: Move parse_mount_options into fill_super X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -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 Signed-off-by: "Eric W. Biederman" --- fs/devpts/inode.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 79a5941c2474..c59d39f2d512 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -395,6 +395,7 @@ static int devpts_fill_super(struct super_block *s, void *data, int silent) { struct inode *inode; + int error; s->s_iflags &= ~SB_I_NODEV; s->s_blocksize = 1024; @@ -403,10 +404,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(s); if (!s->s_fs_info) goto fail; + error = parse_mount_options(data, PARSE_MOUNT, &DEVPTS_SB(s)->mount_opts); + if (error) + goto fail; + + error = -ENOMEM; inode = new_inode(s); if (!inode) goto fail; @@ -424,7 +431,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent) pr_err("get root dentry failed\n"); fail: - return -ENOMEM; + return error; } /* @@ -437,13 +444,8 @@ static struct dentry *devpts_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { int error; - struct pts_mount_opts opts; struct super_block *s; - error = parse_mount_options(data, PARSE_MOUNT, &opts); - if (error) - return ERR_PTR(error); - s = sget(fs_type, NULL, set_anon_super, flags, NULL); if (IS_ERR(s)) return ERR_CAST(s); @@ -455,8 +457,6 @@ static struct dentry *devpts_mount(struct file_system_type *fs_type, s->s_flags |= MS_ACTIVE; } - memcpy(&(DEVPTS_SB(s))->mount_opts, &opts, sizeof(opts)); - error = mknod_ptmx(s); if (error) goto out_undo_sget; -- 2.8.3