Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1636370ybt; Thu, 9 Jul 2020 11:33:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlWuFbUv0jfaCfB4iBq4E/6Gm1tx7ZBBokvhXQZP4X0faD+oTous2AEOpa6T1ZNC1vIdqy X-Received: by 2002:a05:6402:1c11:: with SMTP id ck17mr70058420edb.38.1594319628450; Thu, 09 Jul 2020 11:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594319628; cv=none; d=google.com; s=arc-20160816; b=X9z3609rEEpxyLTCnekl/HV1nF1TzP98E8kO7aPr7axgjkXqJ606BNN5MoRDGu3yzO ZN+/KJOtKlhnL7I5gTKfDOPWRsB5JjgDIryco/ExOMtreDcAVvZRv4a7jU/mTYbg1X6X 09hgp20OsJR0w2AgGCzyOaIup9GxjSPLBppmOPOtimP0tuv9DHNSJ0nvePxytK3XZxiT Rw1Hcb0+uSeMPPkdSzqXYk9L3FMhBS3WxhGwT3TaOvVErv3HZUTSK1lq6Aaw/x/JAu0U 6MyJmIVCYMiNWDHVUrCjwIhbnj5W/w6V3FLqcopG4N7ujsF5iK3Nge9I5Ads6c8LtIDU Mi7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=yHEZyWE7VwCf1x1tRPrzetVIBWLuaxeFrzy7zZmV6S8=; b=o8VY/6GrouYFMTCLWciffFRd7umWvUqPik0HIu4slKzzCAmZejbw8GwwIeCQieeSA/ fzl0T53MPYAxpKhYRkQX8uW0O/kejHvbXv3Q7xtZwD/OE9x+f7/2fKbJ99GlKRMe/HnT ZXeaHj+6URmP3RwfDiL4497n8xFB8IjFY60Yv15hl6kitX50DPQ5P05fHAnbjSLamcuf EwI62hxHvsolerfxo+pFvMHegs/igcilIjuvwHTnk9dtD8/hQeWPFoj1toGHsysWQNDo HXy45ddIVKBxn0wMM1CyqsQnc1TpJn6AHQRi147Gz71Q+ARDSs0dQbXlrV1GWslQIeRY b87g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tw67hNk3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e23si2504858edy.264.2020.07.09.11.33.26; Thu, 09 Jul 2020 11:33:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tw67hNk3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726275AbgGISdG (ORCPT + 99 others); Thu, 9 Jul 2020 14:33:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbgGISdF (ORCPT ); Thu, 9 Jul 2020 14:33:05 -0400 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A49DDC08C5CE; Thu, 9 Jul 2020 11:33:05 -0700 (PDT) Received: by mail-il1-x141.google.com with SMTP id q3so2868941ilt.8; Thu, 09 Jul 2020 11:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yHEZyWE7VwCf1x1tRPrzetVIBWLuaxeFrzy7zZmV6S8=; b=Tw67hNk3iBv5nsp289saAKj/zOMf/f+lZo4rJRRTKWAdZ/r3kS/f7TRKJsYEW28qB0 CmP3w1HmT/D0HlvNvb/eVhV4qv5ApP1Wr7IaGAdKl+FV8iEsVbWUCcEI3ccDkfeZ+6+b kKTaa19ygjl4jrr00ykok0kr/EuJaH8QMYT0clKWFVJroWKqvFI4rl1bl+t591Xv74SK j4LB18BimLvZYbjU27eIun4MA2aZbrK775qwdBVsqfCb7iJw3iSoyTBxesirN28AwNkc TUQaONLA+viqUNdz4WWLgWAu3UrUVWxO7LOuudPe2V+8UBBlfaR96OagOUBrMnd9LIGr rMdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yHEZyWE7VwCf1x1tRPrzetVIBWLuaxeFrzy7zZmV6S8=; b=C8VyRalvL1iOFctQz+/3e6ZiCgQhaYRnPvvtNouvxX0cefo3xcvanLFTHaTMg3HAtz gGLPr2xBoQ/VR6Nos4YJbOEKytmLs4R3Vc+AK2+iR7Cgkv5l39Ht9+T0Bd6YFFQ2m3hc zOXkv+BOXVriMk9LerUOB0NHhQ2AYiWwpkPMkXcZC+SDbleR7N0uKO1JINQhaiebgXMn k5trex2QPWEXgQgOrmdb4OfgazVjqdwU6sWZsuWWNJoUExAW7278grG9//Pc/bdHkrkM zAEJ0UG56jsQHz8EaS/XySbb3yh26/fi0zxhH9U0UbazcWsOIRaKW/jOjABMvkbIveLI qSkg== X-Gm-Message-State: AOAM531yAMZ3okeNgkPYdF2rbN8ppmwKDbvQyiC+UmUcD6jFWMXEnfB3 Pax6b6IJm09Ie864VrZXae/i/pjSzblgiN0PYA== X-Received: by 2002:a92:10a:: with SMTP id 10mr46282742ilb.172.1594319584958; Thu, 09 Jul 2020 11:33:04 -0700 (PDT) MIME-Version: 1.0 References: <20200709151814.110422-1-hch@lst.de> <20200709151814.110422-17-hch@lst.de> In-Reply-To: <20200709151814.110422-17-hch@lst.de> From: Brian Gerst Date: Thu, 9 Jul 2020 14:32:54 -0400 Message-ID: Subject: Re: [PATCH 16/17] init: open code setting up stdin/stdout/stderr To: Christoph Hellwig Cc: Linux Kernel Mailing List , "H. Peter Anvin" , Song Liu , Al Viro , Linus Torvalds , linux-raid@vger.kernel.org, Linux FS-devel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 9, 2020 at 11:19 AM Christoph Hellwig wrote: > > Don't rely on the implicit set_fs(KERNEL_DS) for ksys_open to work, but > instead open a struct file for /dev/console and then install it as FD > 0/1/2 manually. > > Signed-off-by: Christoph Hellwig > --- > fs/file.c | 7 +------ > include/linux/syscalls.h | 1 - > init/main.c | 16 ++++++++++------ > 3 files changed, 11 insertions(+), 13 deletions(-) > > diff --git a/fs/file.c b/fs/file.c > index abb8b7081d7a44..85b7993165dd2f 100644 > --- a/fs/file.c > +++ b/fs/file.c > @@ -985,7 +985,7 @@ SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd) > return ksys_dup3(oldfd, newfd, 0); > } > > -int ksys_dup(unsigned int fildes) > +SYSCALL_DEFINE1(dup, unsigned int, fildes) > { > int ret = -EBADF; > struct file *file = fget_raw(fildes); > @@ -1000,11 +1000,6 @@ int ksys_dup(unsigned int fildes) > return ret; > } > > -SYSCALL_DEFINE1(dup, unsigned int, fildes) > -{ > - return ksys_dup(fildes); > -} > - Please split the removal of the now unused ksys_*() functions into a separate patch. -- Brian Gerst