Received: by 10.213.65.68 with SMTP id h4csp462297imn; Sat, 17 Mar 2018 10:25:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELu92UgeYOjT+JPi/2nmNuVQcKZMIEbrNfAlH05vphnCzvTnLwHNWmU0yAoJHbCuIon5WPRP X-Received: by 2002:a17:902:ab84:: with SMTP id f4-v6mr6493009plr.239.1521307526677; Sat, 17 Mar 2018 10:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521307526; cv=none; d=google.com; s=arc-20160816; b=opfz8MCvYU07sY15o7RL/3+mijmSceUYeWWv2pZicO3/bVLNE0HNcFyENq+F3AkSAl EtXxTimmkMygTfVnC/JULkklYbYrGZexa7SzOS6sHSpRiqfPnFR6vRPctOq5sQVn8ySD LCWRFwLVAw+M/AMyrNpKTOa4Ul3f6hbySsmkCS4mAFNMZqiFP/pti2rZuB1q/PYYzdVW e5ee9hkflwU0BI5d3tv64SwBU5Foj7kVDrlMMGwi1Si7fwadV1wO2FqV/8lrNmuvqi+N m6EJ0H18bA4x/9yVUsFgkASzs549hpLg9kDZF48to/DUggmclfwxZNOg4XCbzegr6qTc j5fA== 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:arc-authentication-results; bh=5Zf741mSgoLuzYI8PzhBQm74RfURrjW0mU0ycukn2UA=; b=AYGHbl2XidobhDn/AKI79A4E2m3E2016EHGRNY9A+e2kUYXOSvdiZkZp4akPY4Uirh g2P5iqeevJq8BGyHlAQhYJGIv9GPbX0BX5wzOzoFY42v7NvjHs/ptWq8k4E3v1WW2Qvy 9l+UfWvrvRrEJaC5BpnzZ/ihkurSDRFSqHlmJxOVmII249YT6bsVkp5F2KwtZ0wLZ0Nu ZRxKynDzTHNP+RRp/SpSH9zO0KuP0bKe9qOTKP35IYFBs40ctsHdITmdH4v+Txulo1O4 e2PXO7vEOx9VZXOFUH/2ZE9X9b0yrKUfQxbpJjiSN5F/9Yv0MknR1vFLHX49+WvQwzJt UdWA== ARC-Authentication-Results: i=1; mx.google.com; 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 n6-v6si1998650plk.569.2018.03.17.10.25.12; Sat, 17 Mar 2018 10:25:26 -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; 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 S1753803AbeCQRWU (ORCPT + 99 others); Sat, 17 Mar 2018 13:22:20 -0400 Received: from isilmar-4.linta.de ([136.243.71.142]:35196 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753352AbeCQRVN (ORCPT ); Sat, 17 Mar 2018 13:21:13 -0400 Received: from light.dominikbrodowski.net (isilmar.linta [10.0.0.1]) by isilmar-4.linta.de (Postfix) with ESMTPS id ADB62200916; Sat, 17 Mar 2018 17:21:10 +0000 (UTC) Received: by light.dominikbrodowski.net (Postfix, from userid 1000) id D3EBB20CC8; Sat, 17 Mar 2018 18:06:50 +0100 (CET) Date: Sat, 17 Mar 2018 18:06:50 +0100 From: Dominik Brodowski To: Christoph Hellwig 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: <20180317170650.GB3351@light.dominikbrodowski.net> References: <20180315190529.20943-1-linux@dominikbrodowski.net> <20180315190529.20943-19-linux@dominikbrodowski.net> <20180316085240.GG4151@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180316085240.GG4151@infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 16, 2018 at 01:52:40AM -0700, Christoph Hellwig wrote: > 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. In line with the other patches, I have added the following paragraph to the commit message: In the near future, the do_mounts / initramfs callers of ksys_write() should be converted to use filp_open() and vfs_write() instead. Thanks, Dominik