public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dominik Brodowski <linux@dominikbrodowski.net>
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()
Date: Fri, 16 Mar 2018 01:52:40 -0700	[thread overview]
Message-ID: <20180316085240.GG4151@infradead.org> (raw)
In-Reply-To: <20180315190529.20943-19-linux@dominikbrodowski.net>

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.

  reply	other threads:[~2018-03-16  8:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180315190529.20943-1-linux@dominikbrodowski.net>
2018-03-15 19:05 ` [PATCH v2 18/36] fs: add ksys_write() helper; remove in-kernel calls to sys_write() Dominik Brodowski
2018-03-16  8:52   ` Christoph Hellwig [this message]
2018-03-17 17:06     ` Dominik Brodowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180316085240.GG4151@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox