Re: Re: [PATCH 09/14] fs: don't change the address limit for ->write_iter in __kernel_write

2020-05-31 Thread Logan Gunthorpe
On 2020-05-29 6:32 a.m., Christoph Hellwig wrote: > On Thu, May 28, 2020 at 11:43:13AM -0700, Linus Torvalds wrote: >> On Wed, May 27, 2020 at 10:41 PM Christoph Hellwig wrote: >>> >>> -ssize_t __kernel_write(struct file *file, const void *buf, size_t count, >>> loff_t *pos) >>> +ssize_t

Re: [PATCH 09/14] fs: don't change the address limit for ->write_iter in __kernel_write

2020-05-29 Thread Christoph Hellwig
On Fri, May 29, 2020 at 07:57:36AM +0200, Christoph Hellwig wrote: > On Thu, May 28, 2020 at 08:00:52PM +0100, Al Viro wrote: > > On Thu, May 28, 2020 at 07:40:38AM +0200, Christoph Hellwig wrote: > > > If we write to a file that implements ->write_iter there is no need > > > to change the address

Re: [PATCH 09/14] fs: don't change the address limit for ->write_iter in __kernel_write

2020-05-29 Thread Christoph Hellwig
On Thu, May 28, 2020 at 11:43:13AM -0700, Linus Torvalds wrote: > On Wed, May 27, 2020 at 10:41 PM Christoph Hellwig wrote: > > > > -ssize_t __kernel_write(struct file *file, const void *buf, size_t count, > > loff_t *pos) > > +ssize_t __kernel_write(struct file *file, const void *buf, size_t

Re: [PATCH 09/14] fs: don't change the address limit for ->write_iter in __kernel_write

2020-05-28 Thread Christoph Hellwig
On Thu, May 28, 2020 at 08:00:52PM +0100, Al Viro wrote: > On Thu, May 28, 2020 at 07:40:38AM +0200, Christoph Hellwig wrote: > > If we write to a file that implements ->write_iter there is no need > > to change the address limit if we send a kvec down. Implement that > > case, and prefer it over

Re: [PATCH 09/14] fs: don't change the address limit for ->write_iter in __kernel_write

2020-05-28 Thread Al Viro
On Thu, May 28, 2020 at 07:40:38AM +0200, Christoph Hellwig wrote: > If we write to a file that implements ->write_iter there is no need > to change the address limit if we send a kvec down. Implement that > case, and prefer it over using plain ->write with a changed address > limit if available.

Re: [PATCH 09/14] fs: don't change the address limit for ->write_iter in __kernel_write

2020-05-28 Thread Linus Torvalds
On Wed, May 27, 2020 at 10:41 PM Christoph Hellwig wrote: > > -ssize_t __kernel_write(struct file *file, const void *buf, size_t count, > loff_t *pos) > +ssize_t __kernel_write(struct file *file, const void *buf, size_t count, > + loff_t *pos) Please don't do these kinds of

Re: [PATCH 09/14] fs: don't change the address limit for ->write_iter in __kernel_write

2020-05-18 Thread Christoph Hellwig
On Sat, May 16, 2020 at 11:04:36AM +0800, Hillf Danton wrote: > > + if (file->f_op->write_iter) { > > + struct kvec iov = { .iov_base = (void *)buf, .iov_len = count }; > > + struct kiocb kiocb; > > + struct iov_iter iter; > > + > > + init_sync_kiocb(,