Re: [RFC][PATCH 10/13] make dump_emit() use vfs_write() instead of banging at ->f_op->write directly

2013-10-08 Thread Linus Torvalds
On Tue, Oct 8, 2013 at 7:06 PM, Al Viro wrote: > On Tue, Oct 08, 2013 at 06:38:47PM -0700, Linus Torvalds wrote: >> On Tue, Oct 8, 2013 at 6:18 PM, Al Viro wrote: >> > >> > Point, but I would argue that we should yell very loud if we get 0 from >> > vfs_write() for non-zero size. I'm not sure if

Re: [RFC][PATCH 10/13] make dump_emit() use vfs_write() instead of banging at ->f_op->write directly

2013-10-08 Thread Al Viro
On Tue, Oct 08, 2013 at 06:38:47PM -0700, Linus Torvalds wrote: > On Tue, Oct 8, 2013 at 6:18 PM, Al Viro wrote: > > > > Point, but I would argue that we should yell very loud if we get 0 from > > vfs_write() for non-zero size. I'm not sure if POSIX allows write(2) > > to return that, but a lot o

Re: [RFC][PATCH 10/13] make dump_emit() use vfs_write() instead of banging at ->f_op->write directly

2013-10-08 Thread Linus Torvalds
On Tue, Oct 8, 2013 at 6:18 PM, Al Viro wrote: > > Point, but I would argue that we should yell very loud if we get 0 from > vfs_write() for non-zero size. I'm not sure if POSIX allows write(2) > to return that, but a lot of userland code won't be expecting that and > won't be able to cope... Ac

Re: [RFC][PATCH 10/13] make dump_emit() use vfs_write() instead of banging at ->f_op->write directly

2013-10-08 Thread Al Viro
On Wed, Oct 09, 2013 at 02:18:33AM +0100, Al Viro wrote: > Point, but I would argue that we should yell very loud if we get 0 from > vfs_write() for non-zero size. I'm not sure if POSIX allows write(2) > to return that, but a lot of userland code won't be expecting that and > won't be able to cop

Re: [RFC][PATCH 10/13] make dump_emit() use vfs_write() instead of banging at ->f_op->write directly

2013-10-08 Thread Al Viro
On Tue, Oct 08, 2013 at 05:52:42PM -0700, Linus Torvalds wrote: > On Tue, Oct 8, 2013 at 5:15 PM, Al Viro wrote: > > > > ... and deal with short writes properly > > .. except you don't. > > > + while (nr) { > > + if (dump_interrupted()) > > + return 0; >

Re: [RFC][PATCH 10/13] make dump_emit() use vfs_write() instead of banging at ->f_op->write directly

2013-10-08 Thread Linus Torvalds
On Tue, Oct 8, 2013 at 5:15 PM, Al Viro wrote: > > ... and deal with short writes properly .. except you don't. > + while (nr) { > + if (dump_interrupted()) > + return 0; > + n = vfs_write(file, addr, nr, &pos); > + if (n < 0)

[RFC][PATCH 10/13] make dump_emit() use vfs_write() instead of banging at ->f_op->write directly

2013-10-08 Thread Al Viro
... and deal with short writes properly - the output might be to pipe, after all; as it is, e.g. no-MMU case of elf_fdpic coredump can write a whole lot more than a page worth of data at one call. Signed-off-by: Al Viro --- fs/coredump.c | 17 - 1 files changed, 12 insertions(