Received: by 10.213.65.68 with SMTP id h4csp253762imn; Fri, 16 Mar 2018 01:55:13 -0700 (PDT) X-Google-Smtp-Source: AG47ELu9F7mPWCXX1JRXCnQC7w4novvC8zN/cHC+TdqClAOZfNaThPcjOyYMmARqFA+liGeT+HCN X-Received: by 10.98.71.210 with SMTP id p79mr908151pfi.47.1521190513910; Fri, 16 Mar 2018 01:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521190513; cv=none; d=google.com; s=arc-20160816; b=VuDAZWIf4Yr3grgUCRDH9dVLgnlsDT2It0hsQsIuh85f4T/BMyvJuKLDyQj9PeEmlm j9PMiI0+jXqSkKFbshB56fDfNfdmDwbzYdNO6yx8CxphJrJZh9HAdnrwpx9UWXiJJ3r8 z3u+Vw+tkjOG9jxJB3aE/0wgoVI+HKYpJrHRpcPUczXU5ACbzHQqsaydThLL5VihKQet m190TEcx79V9pSB2blbrqmZ/ydNNVAMo0+nmByYAbhPHzTRW8PQZLGGOFDDt4M+HUKnq BDRqGnPH/55MNz5HYSBkkTdnQ2m1UfP5et87nx+wa9Q3f1iqmFFAbb5kZX5P4l3oaosb DjVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=I44xMhpepAo7E5EwGcF34hq752mO0hyOcgbgTnrN3j4=; b=FXFy7GUinBBTzUxGf/rjrZv4bUuu/S4kqtMh878bnbUiu7jBfqUd8Gl3/qWU4y4bb3 Ezld8UzSdYnlviIu1I6d8m+MzqpjLdgu1p9ALQlR2X/Cn9zMHHjeGJ6JjN8fne7KqfYI nx066EvEYW+d/1Uw8zWl1/Zr9FmhnbCwOwfQrHTW4xk7QNkWwfat7h5NAzrl+P/T/yet K2lmVvh+E/r6Q/WrqbzyXHKvEeNFTaGRapA3A7oi4FQcIHHeJ5VLaZLCucZt4c3fJFfM yHkwcue4KI2+r80us2BGMaBiGJqi8FivwZqeHnrvyLR43UunjqCc2upXjCqmczZPfU7e WLfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=eTAYeb/t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6-v6si5688145pld.628.2018.03.16.01.55.00; Fri, 16 Mar 2018 01:55:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=eTAYeb/t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753229AbeCPIwn (ORCPT + 99 others); Fri, 16 Mar 2018 04:52:43 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:53060 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752421AbeCPIwl (ORCPT ); Fri, 16 Mar 2018 04:52:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=I44xMhpepAo7E5EwGcF34hq752mO0hyOcgbgTnrN3j4=; b=eTAYeb/t/egQW5NIFBCl4zl9E E4FLCmxVTuEWndnTtBchckhXDOh59qktoNWmVRQS2jXipvb6MYTUtzN5xcqeEc737Xt82VGkHf3C9 U7kwim8GCdG9Qbl+4T/EJScI67XOr60Jt81RvVE4c2btvi4UE+bC3Rt+g6FKwozSaOUF04VJnOxiL ZfLZLm3/yDS4yhEuwx3RFzdLE7UoRx2XzfLzebSjH9C6i23mfhBy12eEUnO1zUxGiBPHEMY/2/JOk eHzqOZUFzIVRXbdJge0RcHDb0lXB3twcV+RQC9CfkR7bb33Igl6ydwVFwlOxbItYGi5UG0ys6vWmu NUBEXh4aw==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1ewl6O-00008P-PN; Fri, 16 Mar 2018 08:52:40 +0000 Date: Fri, 16 Mar 2018 01:52:40 -0700 From: Christoph Hellwig To: Dominik Brodowski Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, viro@zeniv.linux.org.uk, luto@kernel.org, mingo@kernel.org, akpm@linux-foundation.org, arnd@arndb.de, linux-s390@vger.kernel.org Subject: Re: [PATCH v2 18/36] fs: add ksys_write() helper; remove in-kernel calls to sys_write() Message-ID: <20180316085240.GG4151@infradead.org> References: <20180315190529.20943-1-linux@dominikbrodowski.net> <20180315190529.20943-19-linux@dominikbrodowski.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180315190529.20943-19-linux@dominikbrodowski.net> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I really don't like this, as this is the wrong level of abstraction. > diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c > index 79b7a3438d54..5a9cfde5fc28 100644 > --- a/arch/s390/kernel/compat_linux.c > +++ b/arch/s390/kernel/compat_linux.c > @@ -468,7 +468,7 @@ COMPAT_SYSCALL_DEFINE3(s390_write, unsigned int, fd, const char __user *, buf, c > if ((compat_ssize_t) count < 0) > return -EINVAL; > > - return sys_write(fd, buf, count); > + return ksys_write(fd, buf, count); > } This looks bogus to me. Why does s390 have its own compat version of write but not any of the other read and write familty calls? > diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c > index 99e0b649fc0e..2d365c398ccc 100644 > --- a/init/do_mounts_rd.c > +++ b/init/do_mounts_rd.c > @@ -270,7 +270,7 @@ int __init rd_load_image(char *from) > printk("Loading disk #%d... ", disk); > } > sys_read(in_fd, buf, BLOCK_SIZE); > - sys_write(out_fd, buf, BLOCK_SIZE); > + ksys_write(out_fd, buf, BLOCK_SIZE); > #if !defined(CONFIG_S390) > if (!(i % 16)) { > pr_cont("%c\b", rotator[rotate & 0x3]); All the do_mounts / initramfs code should be rewritten to use filp_open and vfs_read/vfs_write instead of adding hacks like this.